class ElementCollection extends BaseCollection (View source)

Class ElementCollection

Properties

protected array $elements Elements from BaseCollection

Methods

array
getElements()

Get elements

add($element)

Add item to collection

array
toData()

Get all elements array data

bool
isEmpty()

Collection is empty

bool
validator($elements)

Valid the added element

__construct(array $elements = [])

ElementCollection constructor.

addElement($title, $description, string $image = '')

Add element

Details

array getElements()

Get elements

Return Value

array

add($element)

Add item to collection

Parameters

$element

array toData()

Get all elements array data

Return Value

array

bool isEmpty()

Collection is empty

Return Value

bool

bool validator($elements)

Valid the added element

Parameters

$elements

Return Value

bool

Exceptions

ValidatorStructureException

__construct(array $elements = [])

ElementCollection constructor.

Parameters

array $elements

Element addElement($title, $description, string $image = '')

Add element

Parameters

$title
$description
string $image

Return Value

Element