@@ 120-131 (lines=12) @@ | ||
117 | * @param array $json |
|
118 | * @return ResourceInterface |
|
119 | */ |
|
120 | public function hydrate(string $class, array $json): ResourceInterface |
|
121 | { |
|
122 | $fullClassName = implode( |
|
123 | '\\', |
|
124 | [ |
|
125 | $this->options[Options::NAMESPACE], |
|
126 | $this->options[Options::NAMESPACE_SUFFIX], |
|
127 | $class, |
|
128 | ] |
|
129 | ); |
|
130 | return $this->hydrateFQCN($fullClassName, $json); |
|
131 | } |
|
132 | ||
133 | /** |
|
134 | * @param string $class |
|
@@ 197-208 (lines=12) @@ | ||
194 | * @param ResourceInterface $object |
|
195 | * @return array |
|
196 | */ |
|
197 | public function extract(string $class, ResourceInterface $object): array |
|
198 | { |
|
199 | $fullClassName = implode( |
|
200 | '\\', |
|
201 | [ |
|
202 | $this->options[Options::NAMESPACE], |
|
203 | $this->options[Options::NAMESPACE_SUFFIX], |
|
204 | $class, |
|
205 | ] |
|
206 | ); |
|
207 | return $this->extractFQCN($fullClassName, $object); |
|
208 | } |
|
209 | ||
210 | /** |
|
211 | * Takes a fully qualified class name and extracts the data for that class from the given $object |