1 | <?php |
||
17 | abstract class Transformer extends TransformerAbstract |
||
18 | { |
||
19 | /** |
||
20 | * Get relations set on the transformer. |
||
21 | * |
||
22 | * @return array |
||
23 | */ |
||
24 | public function getRelations():array |
||
28 | |||
29 | /** |
||
30 | * Set relations on the transformer. |
||
31 | * |
||
32 | * @param array|string $relations |
||
33 | * @return self |
||
34 | */ |
||
35 | public function setRelations($relations) |
||
41 | |||
42 | /** |
||
43 | * Call method for retrieving a relation. This method overrides Fractal's own |
||
44 | * [callIncludeMethod] method to load relations directly from your models. |
||
45 | * |
||
46 | * @param Scope $scope |
||
47 | * @param string $includeName |
||
48 | * @param mixed $data |
||
49 | * @return \League\Fractal\Resource\ResourceInterface|bool |
||
50 | * @throws \Exception |
||
51 | */ |
||
52 | protected function callIncludeMethod(Scope $scope, $includeName, $data) |
||
60 | |||
61 | /** |
||
62 | * Include pivot table data to the response. |
||
63 | * |
||
64 | * @param Pivot $pivot |
||
65 | * @return \League\Fractal\Resource\ResourceInterface|bool |
||
66 | */ |
||
67 | protected function includePivot(Pivot $pivot) |
||
77 | } |