class StructureView extends AbstractView implements JsonSerializable (View source)

The StructureView class.

Traits

The BootableTrait class.

Constants

DEFAULT_MODEL

FORMAT_JSON

FORMAT_XML

FORMAT_YAML

FORMAT_INI

FORMAT_PHP

Methods

__construct(array $data = array(), array $config = null)

Method to instantiate the view.

void
boot()

boot

handleData()

handleData

mixed
getHandledData()

processData

Data
getData()

getData

setData(array $data)

setData

null
get(string $key, mixed $default = null)

get

$this
set(string $key, mixed $value)

set

string
render()

render

string
__toString()

__toString

boolean
offsetExists(mixed $offset)

Is a property exists or not.

mixed
offsetGet(mixed $offset)

Get a property.

void
offsetSet(mixed $offset, mixed $value)

Set a value to property.

void
offsetUnset(mixed $offset)

Unset a property.

string
getName(int $backwards = 2)

getName

setName(string $name)

Method to set property name

getPackage(int $backwards = 4)

Method to get property Package

setPackage(AbstractPackage $package)

Method to set property package

Structure
getConfig()

Method to get property Config

setConfig(Structure $config)

Method to set property config

Structure
__get(string $name)

__get

getModel(string $name = null)

Method to get property Model

setModel(ModelRepository $model, bool $default = null, string $customName = null)

Method to set property model

addModel(string $name, ModelRepository $model, string $default = null)

Method to add model with name.

removeModel(string $name)

removeModel

string
getFormat()

Method to get property Format

setFormat(string $format)

Method to set property format

mixed
jsonSerialize()

Return data which should be serialized by json_encode().

Details

at line line 46
__construct(array $data = array(), array $config = null)

Method to instantiate the view.

Parameters

array $data The data array.
array $config The view config.

void boot()

boot

Return Value

void

AbstractView handleData()

handleData

Return Value

AbstractView

mixed getHandledData()

processData

Return Value

mixed

at line line 85
Data getData()

getData

Return Value

Data

at line line 102
AbstractView setData(array $data)

setData

Parameters

array $data

Return Value

AbstractView Return self to support chaining.

null get(string $key, mixed $default = null)

get

Parameters

string $key
mixed $default

Return Value

null

$this set(string $key, mixed $value)

set

Parameters

string $key
mixed $value

Return Value

$this

string render()

render

Return Value

string

Exceptions

RuntimeException

string __toString()

__toString

Return Value

string

boolean offsetExists(mixed $offset)

Is a property exists or not.

Parameters

mixed $offset Offset key.

Return Value

boolean

mixed offsetGet(mixed $offset)

Get a property.

Parameters

mixed $offset Offset key.

Return Value

mixed The value to return.

Exceptions

InvalidArgumentException

void offsetSet(mixed $offset, mixed $value)

Set a value to property.

Parameters

mixed $offset Offset key.
mixed $value The value to set.

Return Value

void

Exceptions

InvalidArgumentException

void offsetUnset(mixed $offset)

Unset a property.

Parameters

mixed $offset Offset key to unset.

Return Value

void

Exceptions

InvalidArgumentException

string getName(int $backwards = 2)

getName

Parameters

int $backwards

Return Value

string

AbstractView setName(string $name)

Method to set property name

Parameters

string $name

Return Value

AbstractView Return self to support chaining.

AbstractPackage getPackage(int $backwards = 4)

Method to get property Package

Parameters

int $backwards

Return Value

AbstractPackage

AbstractView setPackage(AbstractPackage $package)

Method to set property package

Parameters

AbstractPackage $package

Return Value

AbstractView Return self to support chaining.

Structure getConfig()

Method to get property Config

Return Value

Structure

AbstractView setConfig(Structure $config)

Method to set property config

Parameters

Structure $config

Return Value

AbstractView Return self to support chaining.

Structure __get(string $name)

__get

Parameters

string $name

Return Value

Structure

ModelRepository getModel(string $name = null)

Method to get property Model

Parameters

string $name

Return Value

ModelRepository

AbstractView setModel(ModelRepository $model, bool $default = null, string $customName = null)

Method to set property model

Parameters

ModelRepository $model
bool $default
string $customName

Return Value

AbstractView Return self to support chaining.

AbstractView addModel(string $name, ModelRepository $model, string $default = null)

Method to add model with name.

Parameters

string $name
ModelRepository $model
string $default

Return Value

AbstractView Return self to support chaining.

AbstractView removeModel(string $name)

removeModel

Parameters

string $name

Return Value

AbstractView

PackageRouter getRouter()

getRouter

Return Value

PackageRouter

at line line 114
string getFormat()

Method to get property Format

Return Value

string

at line line 126
StructureView setFormat(string $format)

Method to set property format

Parameters

string $format

Return Value

StructureView Return self to support chaining.

at line line 140
mixed jsonSerialize()

Return data which should be serialized by json_encode().

Return Value

mixed

Exceptions

RuntimeException