1 | <?php |
||
15 | class AspectManager |
||
16 | { |
||
17 | /** |
||
18 | * Gracefully add aspect, this will check |
||
19 | * if model implements AspectsInterface |
||
20 | * and add only if it does. |
||
21 | * |
||
22 | * @see AspectsInterface |
||
23 | * @param AnnotatedInterface $model |
||
24 | * @param $aspect |
||
25 | */ |
||
26 | 178 | public static function addAspect(AnnotatedInterface $model = null, $aspect = '') |
|
41 | |||
42 | /** |
||
43 | * Gracefully remove aspect, this will check |
||
44 | * if model implements AspectsInterface |
||
45 | * and remove only if it does. |
||
46 | * |
||
47 | * @see AspectsInterface |
||
48 | * @param AnnotatedInterface $model |
||
49 | * @param $aspect |
||
50 | */ |
||
51 | 177 | public static function removeAspect(AnnotatedInterface $model = null, $aspect = '') |
|
66 | |||
67 | /** |
||
68 | * Gracefully check if has aspect, this will check |
||
69 | * if model implements `AspectsInterface` |
||
70 | * and check only if it does. If model does not |
||
71 | * implement AspectsInterface it will return `false`, |
||
72 | * like if it has no such aspect. |
||
73 | * |
||
74 | * @see AspectsInterface |
||
75 | * @param AnnotatedInterface $model |
||
76 | * @param $aspect |
||
77 | * @return bool |
||
78 | */ |
||
79 | 27 | public static function hasAspect(AnnotatedInterface $model = null, $aspect = '') |
|
95 | } |