Class SmartObj
Some smarter array functions. This is a very work-in-progress class.
- Alo\Traversables\ArrayObjimplementsIteratorAggregate,ArrayAccess,Countable
Alo\Traversables\SmartObj
Methods summary
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 |
publicAlo\Traversables\SmartObj | #uniqueRecursive( ) Removes all the duplicate values from an array Removes all the duplicate values from an array ReturnsAuthor |
protected | #deleteRegexInternal(string$regex,boolean$recursive,boolean$checkingKey,boolean$inverse,array& $currArray) Internal handler for regex deletion Internal handler for regex deletion Parameters- $regex
string $regex The regular expression- $recursive
boolean $recursive Whther to recurse into child arrays- $checkingKey
boolean $checkingKey true if checking key regex, false if checking value regex- $inverse
boolean $inverse If set to true the method will delete items that do NOT match the regex- $currArray
array $currArray Reference to the currently checked array
Author |
publicAlo\Traversables\SmartObj | #deleteWithValueRegex(string$regex,boolean$recursive=true,boolean$inverse=false) Deletes all elements from an array where the value matches the supplied regular expression Deletes all elements from an array where the value matches the supplied regular expression Parameters- $regex
string $regex The regular expression- $recursive
boolean $recursive Whether to recurse into child arrays- $inverse
boolean $inverse If set to true the method will delete items that do NOT match the regex
ReturnsAuthor |
publicAlo\Traversables\SmartObj | #deleteWithKeyRegex(string$regex,boolean$recursive=true,boolean$inverse=false) Deletes all elements from an array where the key matches the supplied regular expression Deletes all elements from an array where the key matches the supplied regular expression Parameters- $regex
string $regex The regular expression- $recursive
boolean $recursive Whether to recurse into child arrays- $inverse
boolean $inverse If set to true the method will delete items that do NOT match the regex
ReturnsAuthor |
protected | #uniqueRecursiveInternal(array& $curr) Internal handler for uniquefyRecursively Internal handler for uniquefyRecursively Parameters- $curr
array $curr Reference to the currently processed step
Author |
__construct()
,__get()
,__set()
,count()
,getIterator()
,offsetExists()
,offsetGet()
,offsetSet()
,offsetUnset()
,toArray()
Magic methods summary
Properties summary
$data