Source for file Settings.class.php

Documentation is available at Settings.class.php

  1. <?php
  2. /**
  3.  * Gumbo Library Framework
  4.  *
  5.  * LICENSE
  6.  * This library is being released under the terms of the New BSD License.  A
  7.  * copy of the license is packaged with the software (LICENSE.txt).  If no
  8.  * copy is found, a copy of the license template can be found at:
  9.  * http://www.opensource.org/licenses/bsd-license.php
  10.  * 
  11.  * @category Gumbo
  12.  * @package Setting
  13.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  14.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  15.  * @author Michael Luster <mluster79@yahoo.com>
  16.  * @link http://sourceforge.net/projects/phpgumbo
  17.  * @version 0.0.1
  18.  */
  19.  
  20. /**
  21.  * Settings Interface
  22.  * 
  23.  * A Settings Class can hold any number of Setting objects.  Each Setting will be
  24.  * required to have a key associated with it.  This will allow the program
  25.  * to access particular Setting Objects thru a key reference.
  26.  *
  27.  * @category Gumbo
  28.  * @package Setting
  29.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  30.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  31.  * @author Michael Luster <mluster79@yahoo.com>
  32.  * @link http://sourceforge.net/projects/phpgumbo
  33.  * @desc Settings Interface
  34.  * @version 0.0.1
  35.  */
  36.  
  37.     
  38.     /**
  39.      * Adds a setting, overwriting the original setting if exists
  40.      * @postcondition remove all non alpha-numeric (except underscores) characters from $key
  41.      * @param Gumbo_Interface_Setting $setting 
  42.      * @param string $key reference key
  43.      */
  44.     public function addSetting (Gumbo_Interface_Setting $setting$key);
  45.     
  46.     /**
  47.      * Removes a Setting
  48.      * @param string $key 
  49.      */
  50.     public function removeSetting ($key);
  51.     
  52.     /**
  53.      * Resets all Settings
  54.      * @postcondition clears all settings
  55.      */
  56.     public function resetSettings ();
  57.     
  58.     
  59.     
  60.     /**
  61.      * Returns the list of all Settings
  62.      * @return Gumbo_Interface_Setting[] 
  63.      */
  64.     public function getSettings ();
  65.     
  66.     /**
  67.      * Returns a single Setting object based on the key
  68.      * @param string $key 
  69.      * @return Gumbo_Interface_Setting 
  70.      */
  71.     public function getSetting ($key);
  72.     
  73.     /**
  74.      * Returns if a Setting exists
  75.      * @param string $key 
  76.      * @return bool 
  77.      */
  78.     public function isSetting ($key);
  79.     
  80. }
  81.  
  82. ?>