PHP Класс lithium\core\StaticObject

См. также: lithium\core\Object
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$_methodFilters Stores the closures that represent the method filters. They are indexed by called class.
$_parents array Keeps a cached list of each class' inheritance tree.

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

Метод Описание
applyFilter ( mixed $method, Closure $filter = null ) : void Apply a closure to a method of the current static object.
invokeMethod ( string $method, array $params = [] ) : mixed Calls a method on this object with the given parameters. Provides an OO wrapper for forward_static_call_array(), and improves performance by using straight method calls in most cases.
respondsTo ( string $method, boolean $internal = false ) : boolean Determines if a given method can be called.

Защищенные методы

Метод Описание
_filter ( string $method, array $params, Closure $callback, array $filters = [] ) : mixed Executes a set of filters against a method by taking a method's main implementation as a callback, and iteratively wrapping the filters around it.
_instance ( string | object $name, array $options = [] ) : object Returns an instance of a class with given config. The name could be a key from the classes array, a fully namespaced class name, or an object. Typically this method is used in _init to create the dependencies used in the current class.
_parents ( ) : array Gets and caches an array of the parent methods of a class.
_stop ( integer | string $status ) : void Exit immediately. Primarily used for overrides during testing.

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

_filter() защищенный статический Метод

Executes a set of filters against a method by taking a method's main implementation as a callback, and iteratively wrapping the filters around it.
См. также: lithium\util\collection\Filters
protected static _filter ( string $method, array $params, Closure $callback, array $filters = [] ) : mixed
$method string The name of the method being executed.
$params array An associative array containing all the parameters passed into the method.
$callback Closure The method's implementation, wrapped in a closure.
$filters array Additional filters to apply to the method for this call only.
Результат mixed

_instance() защищенный статический Метод

Returns an instance of a class with given config. The name could be a key from the classes array, a fully namespaced class name, or an object. Typically this method is used in _init to create the dependencies used in the current class.
protected static _instance ( string | object $name, array $options = [] ) : object
$name string | object A `classes` key or fully-namespaced class name.
$options array The configuration passed to the constructor.
Результат object

_parents() защищенный статический Метод

Gets and caches an array of the parent methods of a class.
protected static _parents ( ) : array
Результат array Returns an array of parent classes for the current class.

_stop() защищенный статический Метод

Exit immediately. Primarily used for overrides during testing.
protected static _stop ( integer | string $status ) : void
$status integer | string integer range 0 to 254, string printed on exit
Результат void

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

Apply a closure to a method of the current static object.
См. также: lithium\core\StaticObject::_filter()
См. также: lithium\util\collection\Filters
public static applyFilter ( mixed $method, Closure $filter = null ) : void
$method mixed The name of the method to apply the closure to. Can either be a single method name as a string, or an array of method names. Can also be false to remove all filters on the current object.
$filter Closure The closure that is used to filter the method(s), can also be false to remove all the current filters for the given method.
Результат void

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

Calls a method on this object with the given parameters. Provides an OO wrapper for forward_static_call_array(), and improves performance by using straight method calls in most cases.
public static invokeMethod ( string $method, array $params = [] ) : mixed
$method string Name of the method to call.
$params array Parameter list to use when calling `$method`.
Результат mixed Returns the result of the method call.

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

Determines if a given method can be called.
public static respondsTo ( string $method, boolean $internal = false ) : boolean
$method string Name of the method.
$internal boolean Provide `true` to perform check from inside the class/object. When `false` checks also for public visibility; defaults to `false`.
Результат boolean Returns `true` if the method can be called, `false` otherwise.

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

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

Stores the closures that represent the method filters. They are indexed by called class.
protected static $_methodFilters

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

Keeps a cached list of each class' inheritance tree.
protected static array $_parents
Результат array