Ubiquity 2.5.2
php rapid development framework
|
Ubiquity\utils\models$UArrayModels This class is part of Ubiquity. More...
Static Public Member Functions | |
static | sort (array $array, callable $callback) |
Returns a sorted array using a user defined comparison function. | |
static | groupsBy (array $objects, array $gbCallbacks, ?callable $lineCallback=null, ?bool $sort=null) |
Groups an array using an array of user defined comparison functions. | |
static | groupBy (array $objects, callable $gbCallback, ?callable $lineCallback=null, ?bool $sort=null) |
Groups an array using a user defined comparison function. | |
static | asKeyValues (array $objects, $keyFunction=NULL, $valueFunction=NULL) |
Returns an associative array of key/values from an array of objects. | |
static | find (?array $objects, callable $callback) |
Finds and returns the first occurrence of the array satisfying the callback. | |
static | findBy (?array $objects, $value, string $property='id') |
Finds and returns the first occurrence of the array using one of the objects properties. | |
static | findById (?array $objects, $idValue) |
Finds and returns the first occurrence of the array using the objects id. | |
static | contains (?array $objects, callable $callback) |
Checks if an object exist in an array of objects satisfying the callback. | |
static | containsBy (?array $objects, object $object, string $property='id') |
Checks if an object exist in an array of objects using one of the object property. | |
static | containsById (?array $objects, object $object) |
Checks if an object exist in an array of objects using the object id. | |
static | remove (?array $objects, callable $callback) |
Removes the first occurrence of the array satisfying the callback. | |
static | removeBy (?array $objects, object $object, string $property='id') |
Removes an object from an array of objects using one of its properties. | |
static | removeAllBy (?array $objects, object $object, string $property='id') |
Removes objects from an array of objects using one of their properties. | |
static | compute (?array $objects, callable $callable, callable $computeCall) |
static | computeSumProperty (?array $objects, string $propertyName) |
static | computeSum (?array $objects, callable $callable) |
static | removeAll (?array $objects, callable $callback) |
Removes all the occurrences of the array satisfying the callback. | |
static | asArray (array $objects) |
static | asJson (array $objects, int $options=0) |
static | asArrayProperties (array $objects, array $properties) |
static | asJsonProperties (array $objects, array $properties, int $options=0) |
Static Private Member Functions | |
static | getAccessors ($properties, $prefix='get') |
static | callFunction ($object, $callback) |
Ubiquity\utils\models$UArrayModels This class is part of Ubiquity.
Definition at line 14 of file UArrayModels.php.
|
static |
|
static |
array | $objects | |
array | $properties |
Definition at line 327 of file UArrayModels.php.
|
static |
|
static |
array | $objects | |
array | $properties | |
int | $options |
Definition at line 346 of file UArrayModels.php.
|
static |
Returns an associative array of key/values from an array of objects.
array | $objects | |
?string|callable | $keyFunction | |
?string|callable | $valueFunction |
Definition at line 83 of file UArrayModels.php.
|
staticprivate |
|
static |
Definition at line 259 of file UArrayModels.php.
|
static |
Definition at line 274 of file UArrayModels.php.
|
static |
Definition at line 269 of file UArrayModels.php.
|
static |
Checks if an object exist in an array of objects satisfying the callback.
array | $objects | |
callable | $callback |
Definition at line 159 of file UArrayModels.php.
|
static |
Checks if an object exist in an array of objects using one of the object property.
array | $objects | |
object | $object | |
string | $property |
Definition at line 171 of file UArrayModels.php.
|
static |
Checks if an object exist in an array of objects using the object id.
array | $objects | |
object | $object |
Definition at line 187 of file UArrayModels.php.
|
static |
Finds and returns the first occurrence of the array satisfying the callback.
array | null | $objects | |
callable | $callback |
Definition at line 106 of file UArrayModels.php.
|
static |
Finds and returns the first occurrence of the array using one of the objects properties.
array | $objects | |
mixed | $value | |
string | $property | default the id property |
Definition at line 124 of file UArrayModels.php.
|
static |
Finds and returns the first occurrence of the array using the objects id.
array | $objects | |
mixed | $idValue |
Definition at line 144 of file UArrayModels.php.
|
staticprivate |
Definition at line 350 of file UArrayModels.php.
|
static |
Groups an array using a user defined comparison function.
array | $objects | |
callable | $gbCallback | |
callable | null | $lineCallback | |
bool | null | $sort |
Definition at line 55 of file UArrayModels.php.
|
static |
Groups an array using an array of user defined comparison functions.
array | $objects | |
array | $gbCallbacks | |
callable | null | $lineCallback | |
bool | null | $sort |
Definition at line 34 of file UArrayModels.php.
|
static |
Removes the first occurrence of the array satisfying the callback.
array | null | $objects | |
callable | $callback |
Definition at line 202 of file UArrayModels.php.
|
static |
Removes all the occurrences of the array satisfying the callback.
array | null | $objects | |
callable | $callback |
Definition at line 284 of file UArrayModels.php.
|
static |
Removes objects from an array of objects using one of their properties.
array | $objects | |
object | $object | |
string | $property | default the id property |
Definition at line 241 of file UArrayModels.php.
|
static |
Removes an object from an array of objects using one of its properties.
array | $objects | |
object | $object | |
string | $property | default the id property |
Definition at line 219 of file UArrayModels.php.
|
static |
Returns a sorted array using a user defined comparison function.
array | $array | |
callable | $callback |
Definition at line 21 of file UArrayModels.php.