1 | <?php defined('SYSPATH') OR die('No direct script access.'); |
||
11 | abstract class Kohana_Jam_Field extends Jam_Attribute { |
||
12 | |||
13 | /** |
||
14 | * @var string the model's name |
||
15 | */ |
||
16 | public $model; |
||
17 | |||
18 | /** |
||
19 | * @var string the column's name in the database |
||
20 | */ |
||
21 | public $column; |
||
22 | |||
23 | /** |
||
24 | * @var string a pretty name for the field |
||
25 | */ |
||
26 | public $label; |
||
27 | |||
28 | /** |
||
29 | * @var string the field's name in the form |
||
30 | */ |
||
31 | public $name; |
||
32 | |||
33 | /** |
||
34 | * @var boolean a primary key field. |
||
35 | */ |
||
36 | public $primary = FALSE; |
||
37 | |||
38 | /** |
||
39 | * @var boolean the column is present in the database table. Default: TRUE |
||
40 | */ |
||
41 | public $in_db = TRUE; |
||
42 | |||
43 | /** |
||
44 | * @var mixed default value |
||
45 | */ |
||
46 | public $default = NULL; |
||
47 | |||
48 | /** |
||
49 | * @var boolean whether or not empty() values should be converted to NULL |
||
50 | */ |
||
51 | public $convert_empty = FALSE; |
||
52 | |||
53 | /** |
||
54 | * @var mixed the value to convert empty values to. This is only used if convert_empty is TRUE |
||
55 | */ |
||
56 | public $empty_value = NULL; |
||
57 | |||
58 | /** |
||
59 | * @var boolean whether or not NULL values are allowed |
||
60 | */ |
||
61 | public $allow_null = TRUE; |
||
62 | |||
63 | /** |
||
64 | * @var array filters are called whenever data is set on the field |
||
65 | */ |
||
66 | public $filters = array(); |
||
67 | |||
68 | /** |
||
69 | * Sets all options. |
||
70 | * |
||
71 | * @param array $options |
||
72 | */ |
||
73 | 58 | public function __construct($options = array()) |
|
118 | |||
119 | /** |
||
120 | * This is called after construction so that fields can finish |
||
121 | * constructing themselves with a copy of the column it represents. |
||
122 | * |
||
123 | * @param string $model |
||
|
|||
124 | * @param string $column |
||
125 | * @return void |
||
126 | **/ |
||
127 | 7 | public function initialize(Jam_Meta $meta, $name) |
|
136 | |||
137 | /** |
||
138 | * Sets a particular value processed according |
||
139 | * to the class's standards. |
||
140 | * |
||
141 | * @param mixed $value |
||
142 | * @return mixed |
||
143 | **/ |
||
144 | 7 | public function set(Jam_Validated $model, $value, $is_changed) |
|
150 | |||
151 | /** |
||
152 | * Returns a particular value processed according |
||
153 | * to the class's standards. |
||
154 | * |
||
155 | * @param Jam_Model $model |
||
156 | * @param mixed $value |
||
157 | * @return mixed |
||
158 | **/ |
||
159 | 207 | public function get(Jam_Validated $model, $value, $is_changed) |
|
163 | |||
164 | /** |
||
165 | * Called just before saving. |
||
166 | * |
||
167 | * If $in_db, it is expected to return a value suitable for insertion |
||
168 | * into the database. |
||
169 | * |
||
170 | * @param Jam_Model $model |
||
171 | * @param mixed $value |
||
172 | * @param bool $loaded |
||
173 | * @return mixed |
||
174 | */ |
||
175 | 18 | public function convert(Jam_Validated $model, $value, $is_loaded) |
|
179 | |||
180 | /** |
||
181 | * Shortcut for setting a filter |
||
182 | * @param string $filter_name |
||
183 | * @param array $values values, defaults to array(':value') |
||
184 | * @return Jam_Field $this |
||
185 | */ |
||
186 | public function filter($filter_name, $values = NULL) |
||
191 | |||
192 | /** |
||
193 | * Potentially converts the value to NULL or default depending on |
||
194 | * the fields configuration. An array is returned with the first |
||
195 | * element being the new value and the second being a boolean |
||
196 | * as to whether the field should return the value provided or |
||
197 | * continue processing it. |
||
198 | * |
||
199 | * @param mixed $value |
||
200 | * @return array |
||
201 | */ |
||
202 | 283 | protected function _default(Jam_Validated $model, $value) |
|
225 | |||
226 | 11 | public function is_empty($value) |
|
233 | |||
234 | 283 | public function run_filters(Jam_Validated $model, $value) |
|
251 | |||
252 | 3 | public function run_filter(Jam_Validated $model, $value, $filter, array $arguments = array()) |
|
276 | } // End Kohana_Jam_Field |
||
277 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.