PHP 클래스 lithium\core\StaticObject

또한 보기: lithium\core\Object
파일 보기 프로젝트 열기: unionofrad/lithium 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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