@@ 126-137 (lines=12) @@ | ||
123 | * @param array $json |
|
124 | * @return ResourceInterface |
|
125 | */ |
|
126 | public function hydrate(string $class, array $json): ResourceInterface |
|
127 | { |
|
128 | $fullClassName = implode( |
|
129 | '\\', |
|
130 | [ |
|
131 | $this->options[Options::NAMESPACE], |
|
132 | $this->options[Options::NAMESPACE_SUFFIX], |
|
133 | $class, |
|
134 | ] |
|
135 | ); |
|
136 | return $this->hydrateFQCN($fullClassName, $json); |
|
137 | } |
|
138 | ||
139 | /** |
|
140 | * @param string $class |
|
@@ 244-255 (lines=12) @@ | ||
241 | * @param ResourceInterface $object |
|
242 | * @return array |
|
243 | */ |
|
244 | public function extract(string $class, ResourceInterface $object): array |
|
245 | { |
|
246 | $fullClassName = implode( |
|
247 | '\\', |
|
248 | [ |
|
249 | $this->options[Options::NAMESPACE], |
|
250 | $this->options[Options::NAMESPACE_SUFFIX], |
|
251 | $class, |
|
252 | ] |
|
253 | ); |
|
254 | return $this->extractFQCN($fullClassName, $object); |
|
255 | } |
|
256 | ||
257 | /** |
|
258 | * Takes a fully qualified class name and extracts the data for that class from the given $object |