import v1.0.0-RC4 | 2009-05-20
This commit is contained in:
38
modules/default/models/Settings.php
Normal file
38
modules/default/models/Settings.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* @copyright Copyright (C) 2005-2009 Keyboard Monkeys Ltd. http://www.kb-m.com
|
||||
* @license http://creativecommons.org/licenses/BSD/ BSD License
|
||||
* @author Keyboard Monkey Ltd
|
||||
* @since CommunityID 0.9
|
||||
* @package CommunityID
|
||||
* @packager Keyboard Monkeys
|
||||
*/
|
||||
|
||||
class Settings extends Monkeys_Db_Table_Gateway
|
||||
{
|
||||
protected $_name = 'settings';
|
||||
protected $_primary = 'name';
|
||||
|
||||
const MAINTENANCE_MODE = 'maintenance_mode';
|
||||
|
||||
public function get($name)
|
||||
{
|
||||
$select = $this->select()
|
||||
->where('name=?', $name);
|
||||
|
||||
$row = $this->fetchRow($select);
|
||||
|
||||
return $row->value;
|
||||
}
|
||||
|
||||
public function set($name, $value)
|
||||
{
|
||||
$this->update(array('value' => $value), $this->getAdapter()->quoteInto('name=?', $name));
|
||||
}
|
||||
|
||||
public function isMaintenanceMode()
|
||||
{
|
||||
return $this->get(self::MAINTENANCE_MODE);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user