1 | <?php namespace Neomerx\JsonApi\Schema; |
||
26 | class ResourceIdentifierSchemaAdapter implements SchemaProviderInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var SchemaProviderInterface |
||
30 | */ |
||
31 | private $schema; |
||
32 | |||
33 | /** |
||
34 | * @var FactoryInterface |
||
35 | */ |
||
36 | private $factory; |
||
37 | |||
38 | /** |
||
39 | * @param FactoryInterface $factory |
||
40 | * @param SchemaProviderInterface $schema |
||
41 | */ |
||
42 | 3 | public function __construct(FactoryInterface $factory, SchemaProviderInterface $schema) |
|
43 | { |
||
44 | 3 | $this->schema = $schema; |
|
45 | 3 | $this->factory = $factory; |
|
46 | 3 | } |
|
47 | |||
48 | /** |
||
49 | * @inheritdoc |
||
50 | */ |
||
51 | 2 | public function getResourceType() |
|
55 | |||
56 | /** |
||
57 | * @inheritdoc |
||
58 | */ |
||
59 | 1 | public function getSelfSubUrl($resource = null) |
|
60 | { |
||
61 | 1 | return $this->schema->getSelfSubUrl($resource); |
|
62 | } |
||
63 | |||
64 | /** |
||
65 | * @inheritdoc |
||
66 | */ |
||
67 | 2 | public function getId($resource) |
|
71 | |||
72 | /** |
||
73 | * @inheritdoc |
||
74 | */ |
||
75 | 1 | public function getSelfSubLink($resource) |
|
79 | |||
80 | /** |
||
81 | * @inheritdoc |
||
82 | */ |
||
83 | 3 | public function getAttributes($resource) |
|
87 | |||
88 | /** |
||
89 | * @inheritdoc |
||
90 | */ |
||
91 | 2 | public function createResourceObject($resource, $isOriginallyArrayed, $attributeKeysFilter = null) |
|
92 | { |
||
93 | 2 | $attributeKeysFilter = []; |
|
94 | 2 | return $this->factory->createResourceObject($this, $resource, $isOriginallyArrayed, $attributeKeysFilter); |
|
95 | } |
||
96 | |||
97 | /** |
||
98 | * @inheritdoc |
||
99 | */ |
||
100 | 3 | public function getRelationshipObjectIterator($resource, $isPrimary, array $includeRelationships) |
|
101 | { |
||
102 | 3 | return new EmptyIterator(); |
|
103 | } |
||
104 | |||
105 | /** |
||
106 | * @inheritdoc |
||
107 | */ |
||
108 | 3 | public function getResourceLinks($resource) |
|
112 | |||
113 | /** |
||
114 | * @inheritdoc |
||
115 | */ |
||
116 | 1 | public function getIncludedResourceLinks($resource) |
|
120 | |||
121 | /** |
||
122 | * @inheritdoc |
||
123 | */ |
||
124 | 1 | public function isShowAttributesInIncluded() |
|
128 | |||
129 | /** |
||
130 | * @inheritdoc |
||
131 | */ |
||
132 | 1 | public function isShowRelationshipsInIncluded() |
|
136 | |||
137 | /** |
||
138 | * @inheritdoc |
||
139 | */ |
||
140 | 3 | public function getIncludePaths() |
|
144 | |||
145 | /** |
||
146 | * @inheritdoc |
||
147 | */ |
||
148 | 3 | public function getPrimaryMeta($resource) |
|
152 | |||
153 | /** |
||
154 | * @inheritdoc |
||
155 | */ |
||
156 | 1 | public function getInclusionMeta($resource) |
|
160 | |||
161 | /** |
||
162 | * @inheritdoc |
||
163 | */ |
||
164 | 1 | public function getRelationshipsPrimaryMeta($resource) |
|
168 | |||
169 | /** |
||
170 | * @inheritdoc |
||
171 | */ |
||
172 | 1 | public function getRelationshipsInclusionMeta($resource) |
|
176 | |||
177 | /** |
||
178 | * @inheritdoc |
||
179 | */ |
||
180 | 1 | public function getLinkageMeta($resource) |
|
184 | |||
185 | /** |
||
186 | * @inheritdoc |
||
187 | */ |
||
188 | 1 | public function getRelationshipSelfLink($resource, $name, $meta = null, $treatAsHref = false) |
|
192 | |||
193 | /** |
||
194 | * @inheritdoc |
||
195 | */ |
||
196 | 1 | public function getRelationshipRelatedLink($resource, $name, $meta = null, $treatAsHref = false) |
|
200 | } |
||
201 |