TYPO3 API  SVNRelease
ArgumentDefinition.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*                                                                        *
00004  * This script belongs to the FLOW3 package "Fluid".                      *
00005  *                                                                        *
00006  * It is free software; you can redistribute it and/or modify it under    *
00007  * the terms of the GNU Lesser General Public License as published by the *
00008  * Free Software Foundation, either version 3 of the License, or (at your *
00009  * option) any later version.                                             *
00010  *                                                                        *
00011  * This script is distributed in the hope that it will be useful, but     *
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
00013  * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
00014  * General Public License for more details.                               *
00015  *                                                                        *
00016  * You should have received a copy of the GNU Lesser General Public       *
00017  * License along with the script.                                         *
00018  * If not, see http://www.gnu.org/licenses/lgpl.html                      *
00019  *                                                                        *
00020  * The TYPO3 project - inspiring people to share!                         *
00021  *                                                                        */
00022 
00023 /**
00024  * Argument definition of each view helper argument
00025  *
00026  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
00027  */
00028 class Tx_Fluid_Core_ViewHelper_ArgumentDefinition {
00029 
00030     /**
00031      * Name of argument
00032      * @var string
00033      */
00034     protected $name;
00035 
00036     /**
00037      * Type of argument
00038      * @var string
00039      */
00040     protected $type;
00041 
00042     /**
00043      * Description of argument
00044      * @var string
00045      */
00046     protected $description;
00047 
00048     /**
00049      * Is argument required?
00050      * @var boolean
00051      */
00052     protected $required = FALSE;
00053 
00054     /**
00055      * Default value for argument
00056      * @var mixed
00057      */
00058     protected $defaultValue = NULL;
00059 
00060     /**
00061      * TRUE if it is a method parameter
00062      * @var boolean
00063      */
00064     protected $isMethodParameter = FALSE;
00065 
00066     /**
00067      * Constructor for this argument definition.
00068      *
00069      * @param string $name Name of argument
00070      * @param string $type Type of argument
00071      * @param string $description Description of argument
00072      * @param boolean $required TRUE if argument is required
00073      * @param mixed $defaultValue Default value
00074      * @param boolean $isMethodParameter TRUE if this argument is a method parameter
00075      * @author Sebastian Kurfürst <sebastian@typo3.org>
00076      */
00077     public function __construct($name, $type, $description, $required, $defaultValue = NULL, $isMethodParameter = FALSE) {
00078         $this->name = $name;
00079         $this->type = $type;
00080         $this->description = $description;
00081         $this->required = $required;
00082         $this->defaultValue = $defaultValue;
00083         $this->isMethodParameter = $isMethodParameter;
00084     }
00085 
00086     /**
00087      * Get the name of the argument
00088      *
00089      * @return string Name of argument
00090      * @author Sebastian Kurfürst <sebastian@typo3.org>
00091      */
00092     public function getName() {
00093         return $this->name;
00094     }
00095 
00096     /**
00097      * Get the type of the argument
00098      *
00099      * @return string Type of argument
00100      * @author Sebastian Kurfürst <sebastian@typo3.org>
00101      */
00102     public function getType() {
00103         return $this->type;
00104     }
00105 
00106     /**
00107      * Get the description of the argument
00108      *
00109      * @return string Description of argument
00110      * @author Sebastian Kurfürst <sebastian@typo3.org>
00111      */
00112     public function getDescription() {
00113         return $this->description;
00114     }
00115 
00116     /**
00117      * Get the optionality of the argument
00118      *
00119      * @return boolean TRUE if argument is optional
00120      * @author Sebastian Kurfürst <sebastian@typo3.org>
00121      */
00122     public function isRequired() {
00123         return $this->required;
00124     }
00125 
00126     /**
00127      * Get the default value, if set
00128      *
00129      * @return mixed Default value
00130      * @author Sebastian Kurfürst <sebastian@typo3.org>
00131      */
00132     public function getDefaultValue() {
00133         return $this->defaultValue;
00134     }
00135 
00136     /**
00137      * TRUE if it is a method parameter
00138      *
00139      * @return boolean TRUE if it's a method parameter
00140      * @author Sebastian Kurfürst <sebastian@typo3.org>
00141      */
00142     public function isMethodParameter() {
00143         return $this->isMethodParameter;
00144     }
00145 }
00146 
00147 ?>