mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Clarifying some Set documentation. Removing deprecated &get() method.
This commit is contained in:
parent
1a4f806bfd
commit
f231b59cfb
1 changed files with 8 additions and 14 deletions
|
@ -373,8 +373,8 @@ class Set extends Object {
|
||||||
* Bugs as you find them. Suggestions for additional features to imlement are also very welcome!
|
* Bugs as you find them. Suggestions for additional features to imlement are also very welcome!
|
||||||
*
|
*
|
||||||
* @param string $path An absolute XPath 2.0 path
|
* @param string $path An absolute XPath 2.0 path
|
||||||
* @param string $data An array of data to extract from
|
* @param array $data An array of data to extract from
|
||||||
* @param string $options Currently only supports 'flatten' which can be disabled for higher XPath-ness
|
* @param array $options Currently only supports 'flatten' which can be disabled for higher XPath-ness
|
||||||
* @return array An array of matched items
|
* @return array An array of matched items
|
||||||
* @access public
|
* @access public
|
||||||
* @static
|
* @static
|
||||||
|
@ -1141,14 +1141,16 @@ class Set extends Object {
|
||||||
* Allows the application of a callback method to elements of an
|
* Allows the application of a callback method to elements of an
|
||||||
* array extracted by a Set::extract() compatible path.
|
* array extracted by a Set::extract() compatible path.
|
||||||
*
|
*
|
||||||
* @param string $path A Set-compatible path to the array value
|
* @param mixed $path Set-compatible path to the array value
|
||||||
* @param array $data
|
* @param array $data An array of data to extract from & then process with the $callback.
|
||||||
* @param mixed $callback Callback method to be applied to extracted data.
|
* @param mixed $callback Callback method to be applied to extracted data.
|
||||||
* See http://ca2.php.net/manual/en/language.pseudo-types.php#language.types.callback for examples
|
* See http://ca2.php.net/manual/en/language.pseudo-types.php#language.types.callback for examples
|
||||||
* of callback formats.
|
* of callback formats.
|
||||||
* @param array $options
|
* @param array $options Options are:
|
||||||
|
* - type : can be pass, map, or reduce. Map will handoff the given callback
|
||||||
|
* to array_map, reduce will handoff to array_reduce, and pass will
|
||||||
|
* use call_user_func_array().
|
||||||
* @return mixed Result of the callback when applied to extracted data
|
* @return mixed Result of the callback when applied to extracted data
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
function apply($path, $data, $callback, $options = array()) {
|
function apply($path, $data, $callback, $options = array()) {
|
||||||
$defaults = array('type' => 'pass');
|
$defaults = array('type' => 'pass');
|
||||||
|
@ -1170,13 +1172,5 @@ class Set extends Object {
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Deprecated, Set class should be called statically
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function &get() {
|
|
||||||
trigger_error('get() is deprecated. Set class should be called statically', E_USER_WARNING);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
Loading…
Add table
Reference in a new issue