Fixed issue when passing in single IDs
If you tried to use the extended array syntax to query against the primary key (id) and passed it an integer instead of an array, an error was occurring. Thanks @geoffoliver !
This commit is contained in:
parent
6ac911b78a
commit
7ed930d278
1 changed files with 5 additions and 0 deletions
|
@ -432,6 +432,11 @@ class Model extends Object
|
|||
$cache_keys = array();
|
||||
$sorted_records = array();
|
||||
|
||||
if (!is_array($type_or_parameters['conditions'][$this->columns['id']]))
|
||||
{
|
||||
$type_or_parameters['conditions'][$this->columns['id']] = array($type_or_parameters['conditions'][$this->columns['id']]);
|
||||
}
|
||||
|
||||
foreach ($type_or_parameters['conditions'][$this->columns['id']] as $id)
|
||||
{
|
||||
$cache_keys[] = strtoupper($this->model) . '-' . $id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue