import v2.0.0.0_RC3 | 2012-07-01
https://github.com/lucanos/CommunityID -> http://www.itadmins.net/archives/357
This commit is contained in:
20
libs/Monkeys/Db/Table/Gateway.php
Executable file → Normal file
20
libs/Monkeys/Db/Table/Gateway.php
Executable file → Normal file
@ -1,9 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2010 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD Licensese
|
||||
* @author Keyboard Monkeys Ltd.
|
||||
* @package Monkeys Framework
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
abstract class Monkeys_Db_Table_Gateway extends Zend_Db_Table_Abstract
|
||||
{
|
||||
const ASC = 'ASC';
|
||||
const DESC = 'DESC';
|
||||
|
||||
public function getRowInstance($id)
|
||||
{
|
||||
return $this->fetchRow($this->select()->where('id = ?', $id));
|
||||
return $this->find($id)->current();
|
||||
}
|
||||
|
||||
public function getRandomRowInstance(Projects_Model_Project $project)
|
||||
{
|
||||
$select = $this->select()->where('project_id=?', $project->id)->order(new Zend_Db_Expr('RAND()'));
|
||||
|
||||
return $this->fetchRow($select);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user