@@ 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 |
|
@@ 250-261 (lines=12) @@ | ||
247 | * @param ResourceInterface $object |
|
248 | * @return array |
|
249 | */ |
|
250 | public function extract(string $class, ResourceInterface $object): array |
|
251 | { |
|
252 | $fullClassName = implode( |
|
253 | '\\', |
|
254 | [ |
|
255 | $this->options[Options::NAMESPACE], |
|
256 | $this->options[Options::NAMESPACE_SUFFIX], |
|
257 | $class, |
|
258 | ] |
|
259 | ); |
|
260 | return $this->extractFQCN($fullClassName, $object); |
|
261 | } |
|
262 | ||
263 | /** |
|
264 | * Takes a fully qualified class name and extracts the data for that class from the given $object |