| @@ 132-143 (lines=12) @@ | ||
| 129 | * @param array $json |
|
| 130 | * @return ResourceInterface |
|
| 131 | */ |
|
| 132 | public function hydrate(string $class, array $json): ResourceInterface |
|
| 133 | { |
|
| 134 | $fullClassName = implode( |
|
| 135 | '\\', |
|
| 136 | [ |
|
| 137 | $this->options[Options::NAMESPACE], |
|
| 138 | $this->options[Options::NAMESPACE_SUFFIX], |
|
| 139 | $class, |
|
| 140 | ] |
|
| 141 | ); |
|
| 142 | return $this->hydrateFQCN($fullClassName, $json); |
|
| 143 | } |
|
| 144 | ||
| 145 | /** |
|
| 146 | * @param string $class |
|
| @@ 209-220 (lines=12) @@ | ||
| 206 | * @param ResourceInterface $object |
|
| 207 | * @return array |
|
| 208 | */ |
|
| 209 | public function extract(string $class, ResourceInterface $object): array |
|
| 210 | { |
|
| 211 | $fullClassName = implode( |
|
| 212 | '\\', |
|
| 213 | [ |
|
| 214 | $this->options[Options::NAMESPACE], |
|
| 215 | $this->options[Options::NAMESPACE_SUFFIX], |
|
| 216 | $class, |
|
| 217 | ] |
|
| 218 | ); |
|
| 219 | return $this->extractFQCN($fullClassName, $object); |
|
| 220 | } |
|
| 221 | ||
| 222 | /** |
|
| 223 | * Takes a fully qualified class name and extracts the data for that class from the given $object |
|