PHP Класс QueryPath\ExtensionRegistry

QueryPath extensions should call the QueryPath::ExtensionRegistry::extend() function to register their extension classes. The QueryPath library then uses this information to determine what QueryPath extensions should be loaded and executed. Extensions are attached to a Query object. To enable an extension (the easy way), use QueryPath::enable(). This class provides lower-level interaction with the extension mechanism.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$useRegistry Internal flag indicating whether or not the registry should be used for automatic extension loading. If this is false, then implementations should not automatically load extensions.

Защищенные свойства (Protected)

Свойство Тип Описание
$extensionMethodRegistry
$extensionRegistry The extension registry. This should consist of an array of class names.

Открытые методы

Метод Описание
autoloadExtensions ( $boolean = true ) Enable or disable automatic extension loading.
extend ( $classname ) Extend a Query with the given extension class.
extensionNames ( )
getExtensions ( querypath\Query $qp ) : array Get extensions for the given Query object.
getMethodClass ( string $name ) : string Get the class that a given method belongs to.
hasExtension ( string $name ) : boolean Check to see if the given extension class is registered.
hasMethod ( string $name ) : boolean Check to see if a method is known.

Описание методов

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

If extension autoloading is disabled, then QueryPath will not automatically load all registred extensions when a new Query object is created using qp().
public static autoloadExtensions ( $boolean = true )

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

Extend a Query with the given extension class.
public static extend ( $classname )

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

public static extensionNames ( )

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

Given a Query object, this will return an associative array of extension names to (new) instances. Generally, this is intended to be used internally.
public static getExtensions ( querypath\Query $qp ) : array
$qp querypath\Query The Query into which the extensions should be registered.
Результат array An associative array of classnames to instances.

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

Given a method name, this will check all registered extension classes to see if any of them has the named method. If so, this will return the classname. Note that if two extensions are registered that contain the same method name, the last one registred will be the only one recognized.
public static getMethodClass ( string $name ) : string
$name string The name of the method.
Результат string The name of the class.

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

Given a class name for a QueryPath::Extension class, this will check to see if that class is registered. If so, it will return TRUE.
public static hasExtension ( string $name ) : boolean
$name string The name of the class.
Результат boolean TRUE if the class is registered, FALSE otherwise.

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

This checks to see if the given method name belongs to one of the registered extensions. If it does, then this will return TRUE.
public static hasMethod ( string $name ) : boolean
$name string The name of the method to search for.
Результат boolean TRUE if the method exists, false otherwise.

Описание свойств

$extensionMethodRegistry защищенное статическое свойство

protected static $extensionMethodRegistry

$extensionRegistry защищенное статическое свойство

The extension registry. This should consist of an array of class names.
protected static $extensionRegistry

$useRegistry публичное статическое свойство

Internal flag indicating whether or not the registry should be used for automatic extension loading. If this is false, then implementations should not automatically load extensions.
public static $useRegistry