Class SmartObj
Some smarter array functions. This is a very work-in-progress class.
- Alo\Traversables\SmartObjimplementsIteratorAggregate,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 staticAlo\Traversables\SmartObj | #smartObj(array$initial= []) Initialises our smart array-based object Initialises our smart array-based object Parameters- $initial
array $initial The initial array to set
ReturnsAuthor |
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 |
publicAlo\Traversables\SmartObj | #uniqueRecursive( ) Removes all the duplicate values from an array Removes all the duplicate values from an array ReturnsAuthor |
protected | #uniqueRecursiveInternal(array& $curr) Internal handler for uniquefyRecursively Internal handler for uniquefyRecursively Parameters- $curr
array $curr Reference to the currently processed step
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 |