xArray stands for eXtended array. It allows you to manipulate arrays in a different, more comfortable manner. Most methods accept (expect) a lambda/callback parameter - a function that will be executed on all members - so the criteria can be as dynamic and programatic as you need it to be.
Change Log
v0.1 - Start, basic functionallity.
v0.1.1 - Some bug fixes.
v0.2 - Added new methods - eachRecursive(), reach(), reachSingle, reachMultiple(). Added another callback parameter ($_result) to each() and eachRecursive().
v0.3 - Added test cases. Some code refactoring (_getCallback()).
Calls $methodName method on a single xArray object member.
(public) max ($iterator=false)
Returns the element with the greatest result of calling the $iterator callback/lambda for each xArray element, if given. Else returns element with greatest value.
(public) min ($iterator=false)
Returns the element with the smallest result of calling the $iterator callback/lambda for each xArray element, if given. Else returns element with smallest value.
(public) select ($iterator=false, $inPlace=false)
Returns xArray with all elements that return true-a-like value from $iterator callback/lambda. Loose testing.
If given $inPlace parameter, replaces current xArray.
(public) reject ($iterator=false, $inPlace=false)
Returns xArray with all elements that return false-a-like value from $iterator callback/lambda. Loose testing.
If given $inPlace parameter, replaces current xArray.
(public) pluck ($propertyName, $inPlace=false)
Returns xArray with all elements' $propertyName properties.
If given $inPlace parameter, replaces current xArray.
(public) pluckSingle ($propertyName, $id)
Returns a single element's $propertyName property.
(public) sortBy ($iterator, $inPlace=false)
Returns xArray sorted by $iterator callback/lambda result.
If given $inPlace parameter, replaces current xArray.