phpDocumentor ZNF
Action
[ class tree: ZNF ] [ index: ZNF ] [ all elements ]

Source for file ActionForm.php

Documentation is available at ActionForm.php

  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3. /**
  4.  * PHP version 5
  5.  *
  6.  * This source file is subject to version 2.1 of the GNU Lesser General Public
  7.  * License, that is bundled with this package in the file COPYING, available
  8.  * through the world wide web at the following URI:
  9.  * http://www.gnu.org/copyleft/lesser.html.
  10.  *
  11.  * @package    ZNF
  12.  * @subpackage Action
  13.  * @author     Alessandro Rossini <http://www.alessandrorossini.org>
  14.  * @author     Graziano Liberati <http://www.liberati.org>
  15.  * @copyright  2004-2007 The ZNF Development Team
  16.  * @license    LGPL License 2.1 <http://www.gnu.org/copyleft/lesser.html>
  17.  * @version    SVN $Id: ActionForm.php 43 2007-06-26 23:36:35Z aronnax $
  18.  * @since      Release 0.5.0
  19.  * @link       http://www.zeronotice.org
  20.  */
  21.  
  22. /**
  23.  * <i>ZNF_Action_ActionForm</i> checks and filters all properties coming from the form before the <i>ZNF_Action_Action->execute()</i> method is called.
  24.  *
  25.  * Is associated with one or more <i>ZNF_Action_ActionMapping</i>.
  26.  *
  27.  * First the properties must be populated, then if in the module configuration
  28.  * file the <i>validate</i> attribute of the <i>action</i> element is set to
  29.  * <i>true</i> the <i>ZNF_Action_ActionForm->validate()</i> method will be
  30.  * called by the controller <i>ZNF_Action_RequestProcessor</i>, which gives a
  31.  * chance to verify that the properties submitted are corrects and valids.
  32.  *
  33.  * If this method finds problems adds error messages to a
  34.  * <i>ZNF_Action_ActionErrors</i> object. Otherwise, the
  35.  * <i>ZNF_Action_ActionForm->validate()</i> method returns an empty
  36.  * <i>ZNF_Action_ActionErrors</i> object, indicating that everything is
  37.  * acceptable and the corresponding <i>ZNF_Action_Action->execute()</i> method
  38.  * should be called.
  39.  *
  40.  * Subclasses should provide appropriate getter and setter methods for all of
  41.  * the properties they wish to expose, plus override any of the public or
  42.  * protected methods for which they wish to provide modified functionality.
  43.  *
  44.  * @access     public
  45.  * @package    ZNF
  46.  * @subpackage Action
  47.  * @author     Alessandro Rossini <http://www.alessandrorossini.org>
  48.  * @author     Graziano Liberati <http://www.liberati.org>
  49.  * @copyright  2004-2007 The ZNF Development Team
  50.  * @license    LGPL License 2.1 <http://www.gnu.org/copyleft/lesser.html>
  51.  * @version    SVN $Id: ActionForm.php 43 2007-06-26 23:36:35Z aronnax $
  52.  * @since      Release 0.5.0
  53.  * @link       http://www.zeronotice.org
  54.  */
  55. {
  56.  
  57.     /**
  58.      * Constructs a new <i>ZNF_Action_ActionForm</i> object.
  59.      *
  60.      * @access public
  61.      */
  62.     public function __construct()
  63.     {
  64.     }
  65.  
  66.     /**
  67.      * Populates the properties of the class with the properties submitted, must be implemented by subclasses.
  68.      *
  69.      * @access public
  70.      * @return boolean 
  71.      */
  72.     public function populate()
  73.     {
  74.         return false;
  75.     }
  76.  
  77.     /**
  78.      * Validates the properties submitted, must be implemented by subclasses.
  79.      *
  80.      * @access public
  81.      * @return ZNF_Action_ActionErrors 
  82.      */
  83.     public function validate()
  84.     {
  85.         return new ZNF_Action_ActionErrors();
  86.     }
  87.  
  88.     /**
  89.      * Destroys the <i>ZNF_Action_ActionForm</i> object.
  90.      *
  91.      * @access public
  92.      */
  93.     public function __destruct()
  94.     {
  95.     }
  96.  
  97. }
  98.  
  99. /**
  100.  * <i>ZNF_Action_ActionFormException</i> is the exception type for the <i>ZNF_Action_ActionForm</i> class.
  101.  *
  102.  * <i>ZNF_Action_ActionFormException</i> extends the <i>Exception</i> class of PHP5.
  103.  *
  104.  * @access     public
  105.  * @package    ZNF
  106.  * @subpackage Action
  107.  * @author     Alessandro Rossini <http://www.alessandrorossini.org>
  108.  * @author     Graziano Liberati <http://www.liberati.org>
  109.  * @copyright  2004-2007 The ZNF Development Team
  110.  * @license    LGPL License 2.1 <http://www.gnu.org/copyleft/lesser.html>
  111.  * @version    SVN $Id: ActionForm.php 43 2007-06-26 23:36:35Z aronnax $
  112.  * @since      Release 0.5.0
  113.  * @link       http://www.zeronotice.org
  114.  */
  115. class ZNF_Action_ActionFormException extends Exception
  116. {
  117. }
  118.  
  119. ?>

Documentation generated on Wed, 14 Nov 2007 23:47:33 +0100 by phpDocumentor 1.4.0