PHP 클래스 Robbo\Presenter\Presenter

상속: implements ArrayAccess
파일 보기 프로젝트 열기: robclancy/presenter 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$__decorator Decorator The decorator instance so we can nest presenters. Underscores here to avoid conflicts if a presenter or object has "decorator" as a variable.
$object mixed The object injected on Presenter construction.

공개 메소드들

메소드 설명
__call ( string $method, array $arguments ) : mixed Pass any uknown methods through to the inject object.
__construct ( mixed $object ) Create the Presenter and store the object we are presenting.
__get ( string $var ) : mixed Pass any unknown variable calls to present{$variable} or fall through to the injected object.
__isset ( string $name ) : boolean Allow ability to run isset() on a variable
__unset ( string $name ) Allow to unset a variable through the presenter
getObject ( ) : mixed Get the object we are wrapping.
offsetExists ( $offset ) * This will be called when isset() is called via array access.
offsetGet ( mixed $offset ) : mixed Add ability to access properties like an array.
offsetSet ( mixed $offset, mixed $value ) : void Set variable or key value using array access.
offsetUnset ( mixed $offset ) : void Unset a variable or key value using array access.
setExtendedDecorator ( Decorator $decorator ) : void This is so you can extend the decorator and inject it into the presenter at the class level so the new decorator will be used for nested presenters. Method name should be "setDecorator" however like above I want to make conflicts less likely.

보호된 메소드들

메소드 설명
__getDecorator ( ) Get the decorator, if none exists then use the default. Underscores here to avoid conflicts if a presenter or object needs to use "getDecorator".
getPresenterMethodFromVariable ( string $variable ) : string | null Fetch the 'present' method name for the given variable.

메소드 상세

__call() 공개 메소드

Pass any uknown methods through to the inject object.
public __call ( string $method, array $arguments ) : mixed
$method string
$arguments array
리턴 mixed

__construct() 공개 메소드

Create the Presenter and store the object we are presenting.
public __construct ( mixed $object )
$object mixed

__get() 공개 메소드

Pass any unknown variable calls to present{$variable} or fall through to the injected object.
public __get ( string $var ) : mixed
$var string
리턴 mixed

__getDecorator() 보호된 메소드

Get the decorator, if none exists then use the default. Underscores here to avoid conflicts if a presenter or object needs to use "getDecorator".
protected __getDecorator ( )

__isset() 공개 메소드

Allow ability to run isset() on a variable
public __isset ( string $name ) : boolean
$name string
리턴 boolean

__unset() 공개 메소드

Allow to unset a variable through the presenter
public __unset ( string $name )
$name string

getObject() 공개 메소드

Get the object we are wrapping.
public getObject ( ) : mixed
리턴 mixed

getPresenterMethodFromVariable() 보호된 메소드

Fetch the 'present' method name for the given variable.
protected getPresenterMethodFromVariable ( string $variable ) : string | null
$variable string
리턴 string | null

offsetExists() 공개 메소드

* This will be called when isset() is called via array access.
public offsetExists ( $offset )
$offset

offsetGet() 공개 메소드

Add ability to access properties like an array.
public offsetGet ( mixed $offset ) : mixed
$offset mixed
리턴 mixed

offsetSet() 공개 메소드

Set variable or key value using array access.
public offsetSet ( mixed $offset, mixed $value ) : void
$offset mixed
$value mixed
리턴 void

offsetUnset() 공개 메소드

Unset a variable or key value using array access.
public offsetUnset ( mixed $offset ) : void
$offset mixed
리턴 void

setExtendedDecorator() 공개 정적인 메소드

This is so you can extend the decorator and inject it into the presenter at the class level so the new decorator will be used for nested presenters. Method name should be "setDecorator" however like above I want to make conflicts less likely.
public static setExtendedDecorator ( Decorator $decorator ) : void
$decorator Decorator
리턴 void

프로퍼티 상세

$__decorator 보호되어 있는 정적으로 프로퍼티

The decorator instance so we can nest presenters. Underscores here to avoid conflicts if a presenter or object has "decorator" as a variable.
protected static Decorator,Robbo\Presenter $__decorator
리턴 Decorator

$object 보호되어 있는 프로퍼티

The object injected on Presenter construction.
protected mixed $object
리턴 mixed