LdapTools\Factory\AttributeConverterFactory::register PHP Метод

register() публичный статический Метод

Registers a converter so it can be retrieved by its name.
public static register ( string $name, string $class )
$name string The actual name for the converter in the schema.
$class string The fully qualified class name (ie. '\Foo\Bar\Converter')
    public static function register($name, $class)
    {
        if (isset(self::$converterMap[$name])) {
            throw new InvalidArgumentException(sprintf('The attribute converter name "%s" is already registered.', $name));
        }
        self::$converterMap[$name] = $class;
    }

Usage Example

Пример #1
0
 /**
  * Register any explicitly defined converters.
  *
  * @param array $attributeConverters
  */
 protected function registerAttributeConverters(array $attributeConverters)
 {
     foreach ($attributeConverters as $name => $class) {
         AttributeConverterFactory::register($name, $class);
     }
 }