1 | <?php |
||
25 | class MetaProperty implements AnnotationEntityInterface |
||
26 | { |
||
27 | |||
28 | use \Maslosoft\Addendum\Traits\MetaState; |
||
29 | |||
30 | // <editor-fold defaultstate="collapsed" desc="Access Control"> |
||
31 | /** |
||
32 | * Indicates if field has getter |
||
33 | * @var bool |
||
34 | */ |
||
35 | public $callGet = false; |
||
36 | |||
37 | /** |
||
38 | * Indicates if field has setter |
||
39 | * @var bool |
||
40 | */ |
||
41 | public $callSet = false; |
||
42 | |||
43 | /** |
||
44 | * Indicates if field has either getter or setter |
||
45 | * @var bool |
||
46 | */ |
||
47 | public $direct = false; |
||
48 | |||
49 | /** |
||
50 | * Getter method name |
||
51 | * @var string |
||
52 | */ |
||
53 | public $methodGet = ''; |
||
54 | |||
55 | /** |
||
56 | * Setter method name |
||
57 | * @var string |
||
58 | */ |
||
59 | public $methodSet = ''; |
||
60 | |||
61 | /** |
||
62 | * True if property is static |
||
63 | * @var bool |
||
64 | */ |
||
65 | public $isStatic = false; |
||
66 | // </editor-fold> |
||
67 | // <editor-fold defaultstate="collapsed" desc="Default value and property name"> |
||
68 | /** |
||
69 | * Default value of field as defined in class declaration |
||
70 | * @var mixed |
||
71 | */ |
||
72 | public $default = null; |
||
73 | |||
74 | /** |
||
75 | * Name of a field |
||
76 | * @var string |
||
77 | */ |
||
78 | public $name = ''; |
||
79 | |||
80 | // </editor-fold> |
||
81 | |||
82 | /** |
||
83 | * Class constructor, sets some basic data for field |
||
84 | * @param ReflectionProperty $info |
||
85 | */ |
||
86 | 14 | public function __construct(ReflectionProperty $info = null) |
|
87 | { |
||
88 | // For internal use |
||
89 | 14 | if (null === $info) |
|
90 | 14 | { |
|
91 | return; |
||
92 | } |
||
93 | 14 | $this->name = $info->name; |
|
94 | 14 | $this->methodGet = 'get' . ucfirst($this->name); |
|
95 | 14 | $this->methodSet = 'set' . ucfirst($this->name); |
|
96 | 14 | $this->isStatic = $info->isStatic(); |
|
97 | 14 | } |
|
98 | |||
99 | 1 | public function __get($name) |
|
103 | |||
104 | } |
||
105 |