1 | <?php |
||
23 | class Parameter extends Expression |
||
24 | { |
||
25 | |||
26 | const GUID = 0; |
||
27 | |||
28 | const TEXT = 1; |
||
29 | |||
30 | const INTEGER = 4; |
||
31 | |||
32 | const FLOAT = 5; |
||
33 | |||
34 | const MONEY = 6; |
||
35 | |||
36 | const DATE_TIME = 7; |
||
37 | |||
38 | const DATE = 8; |
||
39 | |||
40 | const TIME = 9; |
||
41 | |||
42 | const LOOKUP = 10; |
||
43 | |||
44 | const ENUM = 11; |
||
45 | |||
46 | const BOOLEAN = 12; |
||
47 | |||
48 | const BLOB = 13; |
||
49 | |||
50 | const IMAGE = 14; |
||
51 | |||
52 | const IMAGE_LOOKUP = 16; |
||
53 | |||
54 | const COLOR = 18; |
||
55 | |||
56 | const MAPPING = 26; |
||
57 | |||
58 | protected $keyName = 'Parameter'; |
||
59 | |||
60 | /** |
||
61 | * Sets the input values. |
||
62 | * |
||
63 | * @param mixed $value Value. |
||
64 | * @param int $valueType Data value type. |
||
65 | */ |
||
66 | 4 | public function __construct($value, $valueType = self::TEXT) |
|
73 | |||
74 | /** |
||
75 | * List of supported fields. |
||
76 | * |
||
77 | * @var array |
||
78 | */ |
||
79 | protected $fields = [ |
||
80 | 'dataValueType' => self::TEXT, |
||
81 | 'value' => '', |
||
82 | 'arrayValue' => [], |
||
83 | 'shouldSkipConvertion' => false, |
||
84 | ]; |
||
85 | |||
86 | /** |
||
87 | * Returns data as an associative array. |
||
88 | * |
||
89 | * @return array |
||
90 | * |
||
91 | * @throws ValidateException |
||
92 | */ |
||
93 | 3 | public function getValue() |
|
107 | } |
||
108 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: