![]() |
WPDK
1.5.0
WordPress Development Kit
|
Static Public Member Functions | |
| static | insertKeyValuePairs ($arr, $key, $val, $index=0) |
| Insert a key value pairs in array. More... | |
| static | insert (&$arr, $new, $index=0) |
| Insert an array in array. More... | |
| static | prepend ($array, &$dest) |
| Prepend an array in array. More... | |
| static | append ($array, &$dest) |
| Prepend an array in array. More... | |
| static | wrapArray ($array) |
| Warp each element of an array with an array. More... | |
| static | arrayMatch ($array_keys, $array_match) |
| Match two array by values. More... | |
| static | arrayMatchWithValues ($array, $array_match) |
| Match two array by values. More... | |
| static | arrayMatchWithKeys ($array, $array_match) |
| Match two array by values. More... | |
| static | arrayToObject ($array) |
| Array to object. More... | |
| static | objectToArray ($object) |
| Object to array. More... | |
| static | stripKeys ($source, $keeplist) |
| Brief. More... | |
| static | fit ($source, $defaults) |
| One to one merge. More... | |
| static | httpBuildQuery ($formdata, $numeric_prefix=null, $arg_separator=null) |
| http_build_query() replacement More... | |
| static | arrayWithKey ($array_key, $array_extract) |
| Return an array for key. More... | |
| static | arrayExtractByKey ($sourceArray, $arrayKeys) |
| Return an array for key. More... | |
Static Public Member Functions inherited from WPDKObject | |
| static | __delta ($last_version, $old_version) |
| Object delta compare for combine. More... | |
| static | delta ($last_version, $old_version) |
| static | __dump ($var, $monitor=false) |
| Dump a variable. More... | |
Data Fields | |
| $__version = '1.0.3' | |
| Version. More... | |
Data Fields inherited from WPDKObject | |
| $__version = '1.0.0' | |
| The version number assigned to the class. More... | |
Additional Inherited Members | |
Public Member Functions inherited from WPDKObject | |
| __className () | |
| Returns the class object. More... | |
| __parentClass () | |
| Returns the class object for the receiver’s superclass. More... | |
| __isClass ($class) | |
| Brief. More... | |
| __isSubclassOfClass ($class) | |
| Return TRUE if the receiving class is a subclass of —or identical to— $class, otherwise FALSE. More... | |
Array Helper
The WPDKArray class is an helper that provides a lot of static method for make easy and fast to works with array.
Definition at line 16 of file wpdk-array.php.
|
static |
Prepend an array in array.
Append an array or key value pairs array in a destination array. The $dest array is changed.
| array | $array | Source array to prepend |
| array | $dest | Reference to destination array |
Definition at line 101 of file wpdk-array.php.
|
static |
Return an array for key.
Return a new key value pairs array with element that match with key of the second array. In other words, if the key of $array_extract is found in keys of $array_key, then that element is catch, else is ignored.
| array | $sourceArray | A source key value pairs array that have to match with a specific key |
| array | $arrayKeys | A key value pairs array with the keys to match |
Definition at line 349 of file wpdk-array.php.
|
static |
Match two array by values.
Return a new key value pairs array with element that match with key of the second array. In other words, if the key of $array_match is found in $array_keys, then that element is catch, else is ignored.
| array | $array_keys | An array with the keys for match |
| array | $array_match | A source key value pairs array that have to match with a specific key |
Definition at line 138 of file wpdk-array.php.
|
static |
Match two array by values.
This is an alias of WPDKArray::arrayMatch() for key value pairs array
| array | $array | A key vaues pairs array where the values are used as key for match |
| array | $array_match | A source key value pairs array that have to match with a specific key |
Definition at line 176 of file wpdk-array.php.
|
static |
Match two array by values.
This is an alias of WPDKArray::arrayMatch() for key value pairs array
| array | $array | A key vaues pairs array where the values are used as key for match |
| array | $array_match | A source key value pairs array that have to match with a specific key |
Definition at line 160 of file wpdk-array.php.
|
static |
Array to object.
Convert an array into a stdClass()
| array | $array | The array we want to convert |
Definition at line 194 of file wpdk-array.php.
|
static |
Return an array for key.
Return a new key value pairs array with element that match with key of the second array. In other words, if the key of $array_extract is found in keys of $array_key, then that element is catch, else is ignored.
| array | $array_key | A key value pairs array with the keys to match |
| array | $array_extract | A source key value pairs array that have to match with a specific key |
Definition at line 324 of file wpdk-array.php.
|
static |
One to one merge.
Return a merged array from default and source. If source array has some key miss in defaults array, an unset on that key is performed.
| array | $source | A key pairs array |
| array | $defaults | A key pairs array with default keys and values |
Definition at line 260 of file wpdk-array.php.
|
static |
http_build_query() replacement
Simulates the behavior of http_build_query() in the previous versions of php 5
| array | $formdata | Array $key => $value |
| null | $numeric_prefix | See http_build_query() documentation |
| null | $arg_separator | See http_build_query() documentation |
Definition at line 281 of file wpdk-array.php.
|
static |
Insert an array in array.
Insert an array or key value pairs array in a second array to a specify index
| array | $arr | Source array |
| array | $new | New array |
| int | $index | Optional. Index zero base |
$input = array("red", "green", "blue", "yellow");
array_splice($input, 2);
// $input is now array("red", "green")
Definition at line 63 of file wpdk-array.php.
|
static |
Insert a key value pairs in array.
Insert a key => value into a second array to a specify index
| array | $arr | Source array |
| string | $key | Key |
| mixed | $val | Value |
| int | $index | Optional. Index zero base |
Definition at line 39 of file wpdk-array.php.
|
static |
Object to array.
Convert a object to an array
| object | $object | The object we want to convert |
Definition at line 215 of file wpdk-array.php.
|
static |
Prepend an array in array.
Prepend an array or key value pairs array in a destination array. The $dest array is changed.
| array | $array | Source array to prepend |
| array | $dest | Reference to destination array |
Definition at line 83 of file wpdk-array.php.
|
static |
Brief.
Return a key pairs array start from source without the keys not present in keeplist
| array | $source | Source key pairs array |
| array | $keeplist | Key pairs array with the list of key to keep |
Definition at line 237 of file wpdk-array.php.
|
static |
Warp each element of an array with an array.
Warp each element of an array with an array
| array | $array | An array |
Definition at line 117 of file wpdk-array.php.
| string $__version = '1.0.3' |