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