Class ArrayObj
Makes an object usable as an array
- Alo\Traversables\ArrayObjimplementsIteratorAggregate,ArrayAccess,Countable
Methods summary
public | #__construct(array$initial= []) Initialises our smart array-based object Initialises our smart array-based object Parameters- $initial
array $initial The initial array to set
Author |
public integer | #count( ) Returns the number of items in the data object Returns the number of items in the data object Returnsinteger
AuthorImplementation of |
public mixed | #__get(string$k) Returns an array value Parameters- $k
string $k The value's key
Returnsmixed
Author |
public | #__set(string$k,mixed$v) Sets an array value Parameters- $k
string $k The key- $v
mixed $v The value
Author |
public array | #toArray( ) Returns the data set Returnsarray
Author |
publicArrayIterator | #getIterator( ) Returns the array iterator for our data Returns the array iterator for our data ReturnsAuthorImplementation of |
public boolean | #offsetExists(mixed$offset) Checks whether a offset exists Checks whether a offset exists Parameters- $offset
mixed $offset An offset to check for.
Returnsboolean
AuthorLinkImplementation of |
public mixed | #offsetGet(mixed$offset) Gets an offset Parameters- $offset
mixed $offset The offset to retrieve.
Returnsmixed
AuthorLinkImplementation of |
public | #offsetSet(mixed$offset,mixed$value) Sets an offset Parameters- $offset
mixed $offset The offset to assign the value to.- $value
mixed $value The value to set.
AuthorLinkImplementation of |
public | #offsetUnset(mixed$offset) Unsets an offset Parameters- $offset
mixed $offset The offset to unset.
AuthorLinkImplementation of |
Magic methods summary
Properties summary
protected array | $data | #The array we're working with The array we're working with |