PHP Class Robbo\Presenter\Presenter

Inheritance: implements ArrayAccess
Afficher le fichier Open project: robclancy/presenter Class Usage Examples

Protected Properties

Свойство Type Description
$__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.

Méthodes publiques

Méthode Description
__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.

Méthodes protégées

Méthode Description
__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.

Method Details

__call() public méthode

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

__construct() public méthode

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

__get() public méthode

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

__getDecorator() protected méthode

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() public méthode

Allow ability to run isset() on a variable
public __isset ( string $name ) : boolean
$name string
Résultat boolean

__unset() public méthode

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

getObject() public méthode

Get the object we are wrapping.
public getObject ( ) : mixed
Résultat mixed

getPresenterMethodFromVariable() protected méthode

Fetch the 'present' method name for the given variable.
protected getPresenterMethodFromVariable ( string $variable ) : string | null
$variable string
Résultat string | null

offsetExists() public méthode

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

offsetGet() public méthode

Add ability to access properties like an array.
public offsetGet ( mixed $offset ) : mixed
$offset mixed
Résultat mixed

offsetSet() public méthode

Set variable or key value using array access.
public offsetSet ( mixed $offset, mixed $value ) : void
$offset mixed
$value mixed
Résultat void

offsetUnset() public méthode

Unset a variable or key value using array access.
public offsetUnset ( mixed $offset ) : void
$offset mixed
Résultat void

setExtendedDecorator() public static méthode

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
Résultat void

Property Details

$__decorator protected_oe static_oe property

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
Résultat Decorator

$object protected_oe property

The object injected on Presenter construction.
protected mixed $object
Résultat mixed