W3cubDocs

/Drupal 8

public static function ProxyBuilder::buildProxyNamespace

public static ProxyBuilder::buildProxyNamespace($class_name)

Generates the used proxy namespace from a given class name.

Parameters

string $class_name: The class name of the actual service.

Return value

string The namespace name of the proxy.

File

core/lib/Drupal/Component/ProxyBuilder/ProxyBuilder.php, line 38

Class

ProxyBuilder
Generates the string representation of the proxy service.

Namespace

Drupal\Component\ProxyBuilder

Code

public static function buildProxyNamespace($class_name) {
  $proxy_classname = static::buildProxyClassName($class_name);

  preg_match('/(.+)\\\\[a-zA-Z0-9]+/', $proxy_classname, $match);
  $proxy_namespace = $match[1];
  return $proxy_namespace;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!ProxyBuilder!ProxyBuilder.php/function/ProxyBuilder::buildProxyNamespace/8.1.x