This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
phptsmadmin/application/classes/orm.php
2011-05-01 13:53:27 +10:00

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);
}
}
?>