Source for file Constraint.class.php

Documentation is available at Constraint.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 Constraint 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 Constraint Interface
  30.  * @version 0.0.1
  31.  */
  32.  
  33.     
  34.     /** ACTION METHODS **/
  35.     /**
  36.      * Tests the Constraint, returning either boolean or formatted data
  37.      * @param mixed $data 
  38.      * @return mixed 
  39.      */
  40.     public function test ($data);
  41.     
  42.     /**
  43.      * Adds a Case to the Constraint Method (accepts additional arguments)
  44.      * @param mixed $val 
  45.      */
  46.     public function addCase ($val);
  47.     
  48.     /**
  49.      * Resets all Case Argument
  50.      * @postcondition !getCases()
  51.      */
  52.     public function resetCases ();
  53.     
  54.     
  55.     
  56.     /** MUTATOR METHODS **/
  57.     /**
  58.      * Sets the Function|Method
  59.      * @param string $func 
  60.      * @param string|StdClass$obj 
  61.      */
  62.     public function setMethod ($func$obj=null);
  63.     
  64.     /**
  65.      * Sets the Key, which indicates the location the 'data' argument should be placed (starts at 0 for 1st position)
  66.      * @param int $key 
  67.      */
  68.     public function setKey ($key);
  69.     
  70.     
  71.     
  72.     
  73.     /** ACCESSOR METHODS **/
  74.     /**
  75.      * Returns the Function|Method
  76.      * @return string|array
  77.      */
  78.     public function getMethod ();
  79.     
  80.     /**
  81.      * Returns the Key
  82.      * @return int 
  83.      */
  84.     public function getKey ();
  85.     
  86.     /**
  87.      * Returns the Case Arguments (extra parameters sent to the function)
  88.      * @return array 
  89.      */
  90.     public function getCases ();
  91.     
  92. }
  93.  
  94. ?>