1 | <?php |
||
19 | abstract class AbstractResourceTransformer extends AbstractExplicitTransformer implements ResourceTransformerInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var mixed |
||
23 | */ |
||
24 | protected $data; |
||
25 | |||
26 | /** |
||
27 | * @var callable|TransformerInterface |
||
28 | */ |
||
29 | protected $transformer; |
||
30 | |||
31 | /** |
||
32 | * @param Scope $scope |
||
33 | * @return ResourceInterface |
||
34 | */ |
||
35 | abstract protected function createResource(Scope $scope): ResourceInterface; |
||
36 | |||
37 | /** |
||
38 | * @param Scope $scope |
||
39 | * @return mixed |
||
40 | */ |
||
41 | protected function getData(Scope $scope) |
||
45 | |||
46 | /** |
||
47 | * @param callable $transformer |
||
48 | * @return $this |
||
49 | */ |
||
50 | public function setTransformer(callable $transformer) |
||
55 | |||
56 | /** |
||
57 | * @param mixed $data |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function setData($data) |
||
65 | |||
66 | /** |
||
67 | * @inheritdoc |
||
68 | */ |
||
69 | public function __invoke($data, Scope $scope, string $identifier = null) |
||
84 | } |
||
85 |