1 | <?php |
||
9 | trait HasDynamicMutators |
||
10 | { |
||
11 | /** |
||
12 | * Registered mutation handler. |
||
13 | * |
||
14 | * @var MutationHandlerInterface[] |
||
15 | */ |
||
16 | private static $mutation_handlers = []; |
||
17 | |||
18 | /** |
||
19 | * Set attribute. |
||
20 | * |
||
21 | * @param string $name |
||
22 | * @param mixed $value |
||
23 | */ |
||
24 | public function setAttribute($name, $value) |
||
39 | |||
40 | /** |
||
41 | * Get attribute. |
||
42 | * |
||
43 | * @param mixed $name |
||
44 | * |
||
45 | * @return mixed |
||
46 | */ |
||
47 | public function getAttribute($name) |
||
58 | |||
59 | /** |
||
60 | * Register a mutation handler. |
||
61 | * |
||
62 | * @param MutationHandlerInterface $handler |
||
63 | */ |
||
64 | public static function registerMutationHandler(MutationHandlerInterface $handler) |
||
68 | |||
69 | /** |
||
70 | * Magic call method. |
||
71 | * |
||
72 | * @param $name |
||
73 | * @param $arguments |
||
74 | * |
||
75 | * @return mixed |
||
76 | */ |
||
77 | public function __call($name, $arguments) |
||
91 | } |
||
92 |