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