| @@ 33-49 (lines=17) @@ | ||
| 30 | * | |
| 31 | * @return void | |
| 32 | */ | |
| 33 | public static function bootMetable() | |
| 34 |     { | |
| 35 | $hooks = new Hooks; | |
| 36 | ||
| 37 | foreach ([ | |
| 38 | 'setAttribute', | |
| 39 | 'getAttribute', | |
| 40 | 'toArray', | |
| 41 | 'replicate', | |
| 42 | 'save', | |
| 43 | '__isset', | |
| 44 | '__unset', | |
| 45 | 'queryHook', | |
| 46 |             ] as $method) { | |
| 47 |             static::hook($method, $hooks->{$method}()); | |
| 48 | } | |
| 49 | } | |
| 50 | ||
| 51 | /** | |
| 52 | * Determine wheter method called on the query is customizable by this trait. | |
| @@ 43-57 (lines=15) @@ | ||
| 40 | * | |
| 41 | * @return void | |
| 42 | */ | |
| 43 | public static function bootMappable() | |
| 44 |     { | |
| 45 | $hooks = new Hooks; | |
| 46 | ||
| 47 | foreach ([ | |
| 48 | 'getAttribute', | |
| 49 | 'setAttribute', | |
| 50 | 'save', | |
| 51 | '__isset', | |
| 52 | '__unset', | |
| 53 | 'queryHook', | |
| 54 |             ] as $method) { | |
| 55 |             static::hook($method, $hooks->{$method}()); | |
| 56 | } | |
| 57 | } | |
| 58 | ||
| 59 | /** | |
| 60 | * Custom query handler for querying mapped attributes. | |