PHP Класс Robbo\Presenter\Presenter

Наследование: implements ArrayAccess
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$__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