Source for file Input.class.php

Documentation is available at Input.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 Input
  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.  * Input Interface
  22.  *
  23.  * @category Gumbo
  24.  * @package Input
  25.  * @copyright Copyright (c) 2007, iBayou, Michael Luster
  26.  * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
  27.  * @author Michael Luster <mluster79@yahoo.com>
  28.  * @link http://sourceforge.net/projects/phpgumbo
  29.  * @desc Input Interface
  30.  * @version 0.0.1
  31.  */
  32.  
  33. gumbo_load ("Interface_Constraint");
  34.  
  35. interface Gumbo_Interface_Input {
  36.     
  37.     /** ACTION METHODS **/
  38.     /**
  39.      * Cleans the Data by running through the Constraints
  40.      * @precondition !isChecked()
  41.      * @return bool 
  42.      */
  43.     public function clean ();
  44.     
  45.     /**
  46.      * Adds a Constraint against the Data (additional arguments accepted for Constraint parameters)
  47.      * @postcondition !isChecked()
  48.      * @postcondition !isClean()
  49.      * @param Gumbo_Interface_Constraint $obj 
  50.      */
  51.     public function addConstraint (Gumbo_Interface_Constraint $obj);
  52.     
  53.     /**
  54.      * Adds a return Constraint, which returns a formatted value
  55.      * @postcondition !isChecked()
  56.      * @postcondition !isClean()
  57.      * @param Gumbo_Interface_Constraint $obj 
  58.      */
  59.     public function addReturnConstraint (Gumbo_Interface_Constraint $obj);
  60.     
  61.     /**
  62.      * Resets ALL Constraints
  63.      * @postcondition !getConstraints()
  64.      * @postcondition !isChecked()
  65.      * @postcondition !isClean()
  66.      */
  67.     public function resetConstraints ();
  68.     
  69.     
  70.     
  71.     /** MUTATOR METHODS **/
  72.     /**
  73.      * Sets the input data
  74.      * @postcondition !isChecked()
  75.      * @postcondition !isClean()
  76.      * @param mixed $data 
  77.      */
  78.     public function setData ($data);
  79.     
  80.     /**
  81.      * Sets if ALL Exceptions should be caught, or stop at first Exception
  82.      * @param bool $val 
  83.      */
  84.     public function setRunThru ($val);
  85.     
  86.     
  87.     
  88.     /** ACCESSOR METHODS **/
  89.     /**
  90.      * Returns the Data
  91.      * @param bool $raw as raw data
  92.      * @return mixed 
  93.      */
  94.     public function getData ($raw=false);
  95.     
  96.     /**
  97.      * Returns ALL the Constraints
  98.      * @return Gumbo_Interface_Constraint[] 
  99.      */
  100.     public function getConstraints ();
  101.     
  102.     /**
  103.      * Returns if the Data is clean
  104.      * @return bool 
  105.      */
  106.     public function isClean ();
  107.     
  108.     /**
  109.      * Returns if the Data was checked
  110.      * @return bool 
  111.      */
  112.     public function isChecked ();
  113.     
  114.     /**
  115.      * Returns if all Exceptions should be caught, or stop at first Exception
  116.      * @return bool 
  117.      */
  118.     public function toRunThru ();
  119.     
  120.     
  121. }
  122.  
  123. ?>