@@ 141-152 (lines=12) @@ | ||
138 | * @param array $json |
|
139 | * @return ResourceInterface |
|
140 | */ |
|
141 | public function hydrate(string $class, array $json): ResourceInterface |
|
142 | { |
|
143 | $fullClassName = implode( |
|
144 | '\\', |
|
145 | [ |
|
146 | $this->options[Options::NAMESPACE], |
|
147 | $this->options[Options::NAMESPACE_SUFFIX], |
|
148 | $class, |
|
149 | ] |
|
150 | ); |
|
151 | return $this->hydrateFQCN($fullClassName, $json); |
|
152 | } |
|
153 | ||
154 | /** |
|
155 | * @param string $class |
|
@@ 218-229 (lines=12) @@ | ||
215 | * @param ResourceInterface $object |
|
216 | * @return array |
|
217 | */ |
|
218 | public function extract(string $class, ResourceInterface $object): array |
|
219 | { |
|
220 | $fullClassName = implode( |
|
221 | '\\', |
|
222 | [ |
|
223 | $this->options[Options::NAMESPACE], |
|
224 | $this->options[Options::NAMESPACE_SUFFIX], |
|
225 | $class, |
|
226 | ] |
|
227 | ); |
|
228 | return $this->extractFQCN($fullClassName, $object); |
|
229 | } |
|
230 | ||
231 | /** |
|
232 | * Takes a fully qualified class name and extracts the data for that class from the given $object |