0d03da78bb5089c0d094238b043c860f5082d7a4
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / Core / ViewHelper / ArgumentDefinition.php
1 <?php
2 namespace TYPO3\CMS\Fluid\Core\ViewHelper;
3
4 /* *
5 * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6 * *
7 * It is free software; you can redistribute it and/or modify it under *
8 * the terms of the GNU Lesser General Public License, either version 3 *
9 * of the License, or (at your option) any later version. *
10 * *
11 * The TYPO3 project - inspiring people to share! *
12 * */
13 /**
14 * Argument definition of each view helper argument
15 */
16 class ArgumentDefinition {
17
18 /**
19 * Name of argument
20 *
21 * @var string
22 */
23 protected $name;
24
25 /**
26 * Type of argument
27 *
28 * @var string
29 */
30 protected $type;
31
32 /**
33 * Description of argument
34 *
35 * @var string
36 */
37 protected $description;
38
39 /**
40 * Is argument required?
41 *
42 * @var boolean
43 */
44 protected $required = FALSE;
45
46 /**
47 * Default value for argument
48 *
49 * @var mixed
50 */
51 protected $defaultValue = NULL;
52
53 /**
54 * TRUE if it is a method parameter
55 *
56 * @var boolean
57 */
58 protected $isMethodParameter = FALSE;
59
60 /**
61 * Constructor for this argument definition.
62 *
63 * @param string $name Name of argument
64 * @param string $type Type of argument
65 * @param string $description Description of argument
66 * @param boolean $required TRUE if argument is required
67 * @param mixed $defaultValue Default value
68 * @param boolean $isMethodParameter TRUE if this argument is a method parameter
69 */
70 public function __construct($name, $type, $description, $required, $defaultValue = NULL, $isMethodParameter = FALSE) {
71 $this->name = $name;
72 $this->type = $type;
73 $this->description = $description;
74 $this->required = $required;
75 $this->defaultValue = $defaultValue;
76 $this->isMethodParameter = $isMethodParameter;
77 }
78
79 /**
80 * Get the name of the argument
81 *
82 * @return string Name of argument
83 */
84 public function getName() {
85 return $this->name;
86 }
87
88 /**
89 * Get the type of the argument
90 *
91 * @return string Type of argument
92 */
93 public function getType() {
94 return $this->type;
95 }
96
97 /**
98 * Get the description of the argument
99 *
100 * @return string Description of argument
101 */
102 public function getDescription() {
103 return $this->description;
104 }
105
106 /**
107 * Get the optionality of the argument
108 *
109 * @return boolean TRUE if argument is optional
110 */
111 public function isRequired() {
112 return $this->required;
113 }
114
115 /**
116 * Get the default value, if set
117 *
118 * @return mixed Default value
119 */
120 public function getDefaultValue() {
121 return $this->defaultValue;
122 }
123
124 /**
125 * TRUE if it is a method parameter
126 *
127 * @return boolean TRUE if it's a method parameter
128 */
129 public function isMethodParameter() {
130 return $this->isMethodParameter;
131 }
132 }
133
134 ?>