1 | <?php |
||
23 | trait PropertyAccessTrait |
||
24 | { |
||
25 | use HasReflectorTrait; |
||
26 | |||
27 | /** |
||
28 | * The accessor for this class |
||
29 | * |
||
30 | * @var ConditionalPropertyAccessor |
||
31 | */ |
||
32 | protected $accessor; |
||
33 | |||
34 | /** |
||
35 | * Returns the ConditionalPropertyAccessor for this object, or |
||
36 | * constructs one on the fly if one does not yet exist |
||
37 | * |
||
38 | * @return ConditionalPropertyAccessor |
||
39 | */ |
||
40 | protected function getPropertyAccessor() |
||
53 | |||
54 | /** |
||
55 | * Gets the value of a property, if it is publically readable, |
||
56 | * using the ConditionalPropertyAccessor |
||
57 | * |
||
58 | * @param string $property The property to get |
||
59 | * @return mixed The property value |
||
60 | */ |
||
61 | public function __get($property) |
||
65 | |||
66 | /** |
||
67 | * Sets the value of a property, if it is publically writable, and |
||
68 | * enforces its datatype permissions using the |
||
69 | * ConditionalPropertyAccessor |
||
70 | * |
||
71 | * @param string $property The property to set |
||
72 | * @param mixed $value The value to set |
||
73 | */ |
||
74 | public function __set(string $property, $value) |
||
78 | } |
||
79 |