Admin
[ class tree: Admin ] [ index: Admin ] [ all elements ]

Source for file System.php

Documentation is available at System.php

  1. <?php
  2. /**
  3. * DotBoost Technologies Inc.
  4. * DotKernel Application Framework
  5. *
  6. @category   DotKernel
  7. @package    Admin
  8. @copyright  Copyright (c) 2009 DotBoost  Technologies (http://www.dotboost.com)
  9. @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  10. @version    $Id: System.php 152 2010-06-18 07:39:40Z teo $
  11. */
  12.  
  13. /**
  14. * System Model
  15. * Here are all the actions related to the system settings
  16. @category   DotKernel
  17. @package    Admin
  18. @author     DotKernel Team <team@dotkernel.com>
  19. */
  20. class System
  21. {
  22.     /**
  23.      * Constructor
  24.      * @access public
  25.      */
  26.     public function __construct()
  27.     {
  28.         $this->db Zend_Registry::get('database');
  29.     }
  30.     /**
  31.      * Get settings that are by default editable
  32.      * @access public
  33.      * @param int $isEditable [optional]
  34.      * @return array 
  35.      */
  36.     public function getSettings($isEditable='1')
  37.     {
  38.         $select $this->db->select()
  39.                            ->from('setting')
  40.                            ->where('isEditable = ? '$isEditable);
  41.         return $this->db->fetchAll($select);
  42.     }
  43.     /**
  44.      * Update settings
  45.      * @access public
  46.      * @param array $data 
  47.      * @return void 
  48.      */
  49.     public function updateSettings($data)
  50.     {        
  51.         foreach ($data as $k => $v)
  52.         {            
  53.             $this->db->update('setting'array('value' => $v)$this->db->quoteIdentifier('key').' = '.$this->db->quote($k));
  54.             
  55.         }        
  56.     }
  57. }

Documentation generated on Wed, 21 Jul 2010 07:34:43 +0000 by phpDocumentor 1.4.3