1 | <?php |
||
12 | class RelationshipPropertyExtractor |
||
13 | { |
||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private static $forbiddenFunction = [ |
||
18 | 'forceDelete', |
||
19 | 'forceFill', |
||
20 | 'delete', |
||
21 | 'newQueryWithoutScopes', |
||
22 | 'newQuery', |
||
23 | 'bootIfNotBooted', |
||
24 | 'boot', |
||
25 | 'bootTraits', |
||
26 | 'clearBootedModels', |
||
27 | 'query', |
||
28 | 'onWriteConnection', |
||
29 | 'delete', |
||
30 | 'forceDelete', |
||
31 | 'performDeleteOnModel', |
||
32 | 'flushEventListeners', |
||
33 | 'push', |
||
34 | 'touchOwners', |
||
35 | 'touch', |
||
36 | 'updateTimestamps', |
||
37 | 'freshTimestamp', |
||
38 | 'freshTimestampString', |
||
39 | 'newQuery', |
||
40 | 'newQueryWithoutScopes', |
||
41 | 'newBaseQueryBuilder', |
||
42 | 'usesTimestamps', |
||
43 | 'reguard', |
||
44 | 'isUnguarded', |
||
45 | 'totallyGuarded', |
||
46 | 'syncOriginal', |
||
47 | 'getConnectionResolver', |
||
48 | 'unsetConnectionResolver', |
||
49 | 'getEventDispatcher', |
||
50 | 'unsetEventDispatcher', |
||
51 | '__toString', |
||
52 | '__wakeup', |
||
53 | ]; |
||
54 | |||
55 | /** |
||
56 | * @param $value |
||
57 | * @param $className |
||
58 | * @param ReflectionClass $reflection |
||
59 | * @param Driver $serializer |
||
60 | * |
||
61 | * @return array |
||
62 | */ |
||
63 | public static function getRelationshipAsPropertyName( |
||
109 | |||
110 | /** |
||
111 | * @param $name |
||
112 | * |
||
113 | * @return bool |
||
114 | */ |
||
115 | protected static function isAllowedEloquentModelFunction($name) |
||
119 | |||
120 | /** |
||
121 | * @param $returned |
||
122 | * |
||
123 | * @return bool |
||
124 | */ |
||
125 | protected static function isAnEloquentRelation($returned) |
||
129 | |||
130 | /** |
||
131 | * @param Driver $serializer |
||
132 | * @param Model $model |
||
133 | * |
||
134 | * @return array |
||
135 | */ |
||
136 | protected static function getModelData(Driver $serializer, Model $model) |
||
144 | } |
||
145 |