mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Merge branch '1.2' of dev@code.cakephp.org:cakephp into 1.2
This commit is contained in:
commit
f59e4013c7
3 changed files with 29 additions and 16 deletions
|
@ -77,8 +77,9 @@ class ContainableBehavior extends ModelBehavior {
|
|||
* Runs before a find() operation. Used to allow 'contain' setting
|
||||
* as part of the find call, like this:
|
||||
*
|
||||
* Model->find('all', array('contain' => array('Model1', 'Model2')));
|
||||
* `Model->find('all', array('contain' => array('Model1', 'Model2')));`
|
||||
*
|
||||
* {{{
|
||||
* Model->find('all', array('contain' => array(
|
||||
* 'Model1' => array('Model11', 'Model12'),
|
||||
* 'Model2',
|
||||
|
@ -87,6 +88,7 @@ class ContainableBehavior extends ModelBehavior {
|
|||
* 'Model32',
|
||||
* 'Model33' => array('Model331', 'Model332')
|
||||
* )));
|
||||
* }}}
|
||||
*
|
||||
* @param object $Model Model using the behavior
|
||||
* @param array $query Query parameters as set by cake
|
||||
|
|
|
@ -453,7 +453,7 @@ class Model extends Overloadable {
|
|||
*
|
||||
* @param mixed $model A model or association name (string) or set of binding options (indexed by model name type)
|
||||
* @param array $options If $model is a string, this is the list of association properties with which $model will
|
||||
* be bound
|
||||
* be bound
|
||||
* @param boolean $permanent Set to true to make the binding permanent
|
||||
* @return void
|
||||
* @access public
|
||||
|
@ -757,10 +757,12 @@ class Model extends Overloadable {
|
|||
$this->schema();
|
||||
}
|
||||
/**
|
||||
* This function does two things: 1) it scans the array $one for the primary key,
|
||||
* This function does two things:
|
||||
*
|
||||
* 1. it scans the array $one for the primary key,
|
||||
* and if that's found, it sets the current id to the value of $one[id].
|
||||
* For all other keys than 'id' the keys and values of $one are copied to the 'data' property of this object.
|
||||
* 2) Returns an array with all of $one's keys and values.
|
||||
* 2. Returns an array with all of $one's keys and values.
|
||||
* (Alternative indata: two strings, which are mangled to
|
||||
* a one-item, two-dimensional array using $one for a key and $two as its value.)
|
||||
*
|
||||
|
@ -1377,7 +1379,7 @@ class Model extends Overloadable {
|
|||
*
|
||||
* @param array $keys Optional foreign key data, defaults to the information $this->data
|
||||
* @param boolean $created True if a new record was created, otherwise only associations with
|
||||
* 'counterScope' defined get updated
|
||||
* 'counterScope' defined get updated
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
|
@ -1912,14 +1914,19 @@ class Model extends Overloadable {
|
|||
* second parameter options for finding ( indexed array, including: 'conditions', 'limit',
|
||||
* 'recursive', 'page', 'fields', 'offset', 'order')
|
||||
*
|
||||
* Eg: find('all', array(
|
||||
* 'conditions' => array('name' => 'Thomas Anderson'),
|
||||
* 'fields' => array('name', 'email'),
|
||||
* 'order' => 'field3 DESC',
|
||||
* 'recursive' => 2,
|
||||
* 'group' => 'type'));
|
||||
* Eg:
|
||||
* {{{
|
||||
* find('all', array(
|
||||
* 'conditions' => array('name' => 'Thomas Anderson'),
|
||||
* 'fields' => array('name', 'email'),
|
||||
* 'order' => 'field3 DESC',
|
||||
* 'recursive' => 2,
|
||||
* 'group' => 'type'
|
||||
* ));
|
||||
* }}}
|
||||
*
|
||||
* Specifying 'fields' for new-notation 'list':
|
||||
*
|
||||
* - If no fields are specified, then 'id' is used for key and 'model->displayField' is used for value.
|
||||
* - If a single field is specified, 'id' is used for key and specified field is used for value.
|
||||
* - If three fields are specified, they are used (in order) for key, value and group.
|
||||
|
|
|
@ -340,9 +340,11 @@ class Set extends Object {
|
|||
return $out;
|
||||
}
|
||||
/**
|
||||
* Implements partial support for XPath 2.0. If $path is an array or $data is empty it the call is delegated to Set::classicExtract.
|
||||
* Implements partial support for XPath 2.0. If $path is an array or $data is empty it the call
|
||||
* is delegated to Set::classicExtract.
|
||||
*
|
||||
* #### Currently implemented selectors:
|
||||
*
|
||||
* Currently implemented selectors:
|
||||
* - /User/id (similar to the classic {n}.User.id)
|
||||
* - /User[2]/name (selects the name of the second User)
|
||||
* - /User[id>2] (selects all Users with an id > 2)
|
||||
|
@ -355,11 +357,13 @@ class Set extends Object {
|
|||
* - /Comment[text=/cakephp/i] (Selects the all comments that have a text matching the regex /cakephp/i)
|
||||
* - /Comment/@* (Selects the all key names of all comments)
|
||||
*
|
||||
* Other limitations:
|
||||
* #### Other limitations:
|
||||
*
|
||||
* - Only absolute paths starting with a single '/' are supported right now
|
||||
*
|
||||
* Warning: Even so it has plenty of unit tests the XPath support has not gone through a lot of real-world testing. Please report
|
||||
* Bugs as you find them. Suggestions for additional features to imlement are also very welcome!
|
||||
* **Warning**: Even so it has plenty of unit tests the XPath support has not gone through a lot of
|
||||
* real-world testing. Please report Bugs as you find them. Suggestions for additional features to
|
||||
* implement are also very welcome!
|
||||
*
|
||||
* @param string $path An absolute XPath 2.0 path
|
||||
* @param string $data An array of data to extract from
|
||||
|
|
Loading…
Add table
Reference in a new issue