AbstractCollection

Implements \IteratorAggregate, \Countable

Class AbstractCollection

category

System

package

Shared

Methods

Initialize the collection instance.

__construct(array|mixed|null $argumentsArray = null) 
Throws
\InvalidArgumentException

Arguments

$argumentsArray

array|mixed|null

Add a new item.

_add(mixed $item) 

This method must be used by child-collection classes.

Throws
\InvalidArgumentException

When $item has an invalid type.

Arguments

$item

mixed

Item which should add to the collection

Get exception text.

_getExceptionText() : string

Response

string

Get valid type.

_getValidType() : string
abstract

This method must be implemented in the child-collection classes.

Response

string

Check if a new item has the valid collection type.

_itemIsValid(mixed $dataItem) : boolean

Arguments

$dataItem

mixed

Response

boolean

Get collection item count.

count() : integer

Response

integer

Get the collection as an array.

getArray() : array

Response

array

Get specific collection item by index.

getItem( $p_index) : mixed
Throws
\InvalidArgumentException

if index is not numeric | OutOfBoundsException if index is out of bounds

Arguments

$p_index

Response

mixed

getIterator

getIterator() 

Determine whether the collection is empty or not.

isEmpty() : boolean

Response

boolean

Properties

Content Collection

collectionContentArray : array
var

Type(s)

array