A collection of Cactus Entities

package Cactus
author Dave Widmer

 Methods

Adds data to the collection.

__construct(array $data) 

Parameters

$data

array

The data to set

Add an item to the result set.

add(mixed $item) 

Parameters

$item

mixed

The item to add to the result set

Gets the number of items in the result set.

count() : int

Returns

intThe number of items in the result set

Return the current element

current() : mixed

link http://php.net/manual/en/iterator.current.php

Returns

mixedCan return any type.

Return the key of the current element

key() : \Cactus\scalar

link http://php.net/manual/en/iterator.key.php

Returns

\Cactus\scalarscalar on success, integer 0 on failure.

Whether a offset exists.

offsetExists(mixed $offset) : boolean

link http://php.net/manual/en/arrayaccess.offsetexists.php

Parameters

$offset

mixed

An offset to check for

Returns

booleantrue on success or false on failure.

Offset to retrieve

offsetGet(mixed $offset) : mixed

link http://php.net/manual/en/arrayaccess.offsetget.php

Parameters

$offset

mixed

The offset to retrieve.

Returns

mixedCan return all value types.

Offset to set

offsetSet(mixed $offset, mixed $value) 

link http://php.net/manual/en/arrayaccess.offsetset.php

Parameters

$offset

mixed

The offset to assign the value to.

$value

mixed

The value to set.

Offset to unset

offsetUnset(mixed $offset) 

link http://php.net/manual/en/arrayaccess.offsetunset.php

Parameters

$offset

mixed

The offset to unset.

Rewind the Iterator to the first element

rewind() 

Checks if current position is valid

valid() : boolean

link http://php.net/manual/en/iterator.valid.php

Returns

booleanReturns true on success or false on failure.

 Properties

 

The internal result array

$data : array