40 lines
1004 B
PHP
40 lines
1004 B
PHP
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||
|
|
||
|
/**
|
||
|
* This class overrides the Kohana ORM for some TSM specific calls.
|
||
|
*
|
||
|
* @package PTA
|
||
|
* @subpackage ORM
|
||
|
* @category Overrides
|
||
|
* @author Deon George
|
||
|
* @copyright (c) 2010 phpTSMadmin Development Team
|
||
|
* @license http://phptsmadmin.sf.net/license.html
|
||
|
*/
|
||
|
class ORM extends Kohana_ORM {
|
||
|
/**
|
||
|
* Override Kohana's FIND to remove the LIMIT
|
||
|
*/
|
||
|
public function find($id = NULL) {
|
||
|
// Since TSM doesnt support LIMIT, we'll use find_all() but return the first record
|
||
|
foreach ($this->find_all() as $object) {
|
||
|
$this->_load_values($object->_object);
|
||
|
|
||
|
return;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* We need to call our own _load_values() to support find() and TSM::result()
|
||
|
*
|
||
|
* (Since _load_values is protected, we need to make it public here,
|
||
|
* so that it can be called in TSM::result().)
|
||
|
*
|
||
|
* @see TSM::result
|
||
|
* @see ORM::find
|
||
|
*/
|
||
|
public function _load_values(array $values) {
|
||
|
return parent::_load_values($values);
|
||
|
}
|
||
|
}
|
||
|
?>
|