pluf2

pluf2 Commit Details


Date:2009-07-13 04:44:36 (15 years 5 months ago)
Author:Loic d'Anterroches
Branch:master
Commit:f67ef4ce2835e03fa2a97f2018fbc83bf32eeccd
Parents: 129080c09e4acc90586ca5dc70159ef5407a0029
Message:Added the ability to pass the filter string directly in the getOne method.

Changes:

File differences

src/Pluf/Model.php
420420
421421
422422
423
424
425
423426
427
424428
425429
426430
427431
432
433
434
428435
429436
430437
* <pre>
* $m = Pluf::factory('My_Model')->getOne(array('filter' => 'id=1'));
* </pre>
* <pre>
* $m = Pluf::factory('My_Model')->getOne('id=1');
* </pre>
*
* @param array|string Filter string or array given to getList
* @see self::getList
*/
public function getOne($p=array())
{
if (!is_array($p)) {
$p = array('filter' => $p);
}
$items = $this->getList($p);
if ($items->count() == 1) {
return $items[0];

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.05849s using 13 queries.