mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Removed the support to notation of 1.2.
This commit is contained in:
parent
31679c3efa
commit
5bfa0867ef
1 changed files with 5 additions and 16 deletions
|
@ -2073,7 +2073,7 @@ class Model extends Object {
|
||||||
/**
|
/**
|
||||||
* Queries the datasource and returns a result set array.
|
* Queries the datasource and returns a result set array.
|
||||||
*
|
*
|
||||||
* Also used to perform new-notation finds, where the first argument is type of find operation to perform
|
* Also used to perform notation finds, where the first argument is type of find operation to perform
|
||||||
* (all / first / count / neighbors / list / threaded ),
|
* (all / first / count / neighbors / list / threaded ),
|
||||||
* second parameter options for finding ( indexed array, including: 'conditions', 'limit',
|
* second parameter options for finding ( indexed array, including: 'conditions', 'limit',
|
||||||
* 'recursive', 'page', 'fields', 'offset', 'order')
|
* 'recursive', 'page', 'fields', 'offset', 'order')
|
||||||
|
@ -2109,30 +2109,19 @@ class Model extends Object {
|
||||||
*
|
*
|
||||||
* Behaviors and find types can also define custom finder keys which are passed into find().
|
* Behaviors and find types can also define custom finder keys which are passed into find().
|
||||||
*
|
*
|
||||||
* Specifying 'fields' for new-notation 'list':
|
* Specifying 'fields' for notation 'list':
|
||||||
*
|
*
|
||||||
* - If no fields are specified, then 'id' is used for key and 'model->displayField' is used for value.
|
* - 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 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.
|
* - If three fields are specified, they are used (in order) for key, value and group.
|
||||||
* - Otherwise, first and second fields are used for key and value.
|
* - Otherwise, first and second fields are used for key and value.
|
||||||
*
|
*
|
||||||
* @param array $conditions SQL conditions array, or type of find operation (all / first / count /
|
* @param string $type Type of find operation (all / first / count / neighbors / list / threaded)
|
||||||
* neighbors / list / threaded)
|
* @param array $query Option fields (conditions / fields / joins / limit / offset / order / page / group / callbacks)
|
||||||
* @param mixed $fields Either a single string of a field name, or an array of field names, or
|
|
||||||
* options for matching
|
|
||||||
* @param string $order SQL ORDER BY conditions (e.g. "price DESC" or "name ASC")
|
|
||||||
* @param integer $recursive The number of levels deep to fetch associated records
|
|
||||||
* @return array Array of records
|
* @return array Array of records
|
||||||
* @link http://book.cakephp.org/view/1018/find
|
* @link http://book.cakephp.org/view/1018/find
|
||||||
*/
|
*/
|
||||||
public function find($conditions = null, $fields = array(), $order = null, $recursive = null) {
|
public function find($type = 'first', $query = array()) {
|
||||||
if (!is_string($conditions) || (is_string($conditions) && !array_key_exists($conditions, $this->_findMethods))) {
|
|
||||||
$type = 'first';
|
|
||||||
$query = array_merge(compact('conditions', 'fields', 'order', 'recursive'), array('limit' => 1));
|
|
||||||
} else {
|
|
||||||
list($type, $query) = array($conditions, $fields);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->findQueryType = $type;
|
$this->findQueryType = $type;
|
||||||
$this->id = $this->getID();
|
$this->id = $this->getID();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue