1 | <?php |
||
35 | trait ParamsTrait |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * The array with the formatter's params. |
||
40 | * |
||
41 | * @var array |
||
42 | * @Type("array") |
||
43 | */ |
||
44 | protected $params = array(); |
||
45 | |||
46 | /** |
||
47 | * The delimiter for the params that should be converted into an array. |
||
48 | * |
||
49 | * @var string |
||
50 | * @Type("string") |
||
51 | * @SerializedName("param-delimiter") |
||
52 | */ |
||
53 | protected $paramDelimiter = ','; |
||
54 | |||
55 | /** |
||
56 | * Return's the parameter delimiter. |
||
57 | * |
||
58 | * @return string The delimiter |
||
59 | */ |
||
60 | public function getParamDelimiter() |
||
64 | |||
65 | /** |
||
66 | * Return's the array with the params. |
||
67 | * |
||
68 | * @return array The params |
||
69 | */ |
||
70 | public function getParams() |
||
84 | |||
85 | /** |
||
86 | * Query whether or not the param with the passed name exists. |
||
87 | * |
||
88 | * @param string $name The name of the param to be queried |
||
89 | * |
||
90 | * @return boolean TRUE if the requested param exists, else FALSE |
||
91 | */ |
||
92 | public function hasParam($name) |
||
96 | |||
97 | /** |
||
98 | * Return's the param with the passed name. |
||
99 | * |
||
100 | * @param string $name The name of the param to return |
||
101 | * @param mixed $defaultValue The default value if the param doesn't exists |
||
102 | * |
||
103 | * @return string The requested param |
||
104 | * @throws \Exception Is thrown, if the requested param is not available |
||
105 | */ |
||
106 | public function getParam($name, $defaultValue = null) |
||
130 | } |
||
131 |