ViewNode
in package
implements
ArrayAccess, Countable, IteratorAggregate, JsonSerializable
Read-only node of the invoice view model with recorded property access.
Templates use object syntax ($invoice->seller->name). Every read of a leaf value that is
not null (scalar or formatted value) is recorded in the access log, so that the mandatory
field guard can tell which values a custom template printed. A value counts as printed
when it is read as a leaf: also in a condition such as if ($invoice->buyer->vatId) and
while a loop reads the items of a list. Counting a list (count(), isEmpty(), isset()) and
reading null values are not recorded: count($invoice->legalNotes) prints no note.
Tags
Table of Contents
Interfaces
- ArrayAccess
- Countable
- IteratorAggregate
- JsonSerializable
Properties
Methods
- __construct() : mixed
- __get() : mixed
- __isset() : bool
- count() : int
- getIterator() : Traversable
- Items are read (and recorded) one by one while the template loops over them.
- isEmpty() : bool
- jsonSerialize() : mixed
- offsetExists() : bool
- offsetGet() : mixed
- offsetSet() : void
- offsetUnset() : void
- toArray() : array<string|int, mixed>
- Plain values, e.g. for implode(); counts as reading every value below this node.
- read() : mixed
Properties
$data
protected
array<string|int, mixed>
$data
$log
protected
AccessLog
$log
$path
protected
string
$path
= ''
Methods
__construct()
public
__construct(array<string|int, mixed> $data, AccessLog $log[, string $path = '' ]) : mixed
Parameters
- $data : array<string|int, mixed>
- $log : AccessLog
- $path : string = ''
__get()
public
__get(string $name) : mixed
Parameters
- $name : string
__isset()
public
__isset(string $name) : bool
Parameters
- $name : string
Return values
boolcount()
public
count() : int
Return values
intgetIterator()
Items are read (and recorded) one by one while the template loops over them.
public
getIterator() : Traversable
Return values
TraversableisEmpty()
public
isEmpty() : bool
Return values
booljsonSerialize()
public
jsonSerialize() : mixed
offsetExists()
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
offsetSet()
public
offsetSet(mixed $offset, mixed $value) : void
Parameters
- $offset : mixed
- $value : mixed
offsetUnset()
public
offsetUnset(mixed $offset) : void
Parameters
- $offset : mixed
toArray()
Plain values, e.g. for implode(); counts as reading every value below this node.
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>read()
protected
read(string|int $key) : mixed
Parameters
- $key : string|int