| @@ 125-136 (lines=12) @@ | ||
| 122 | * @param array $json |
|
| 123 | * @return ResourceInterface |
|
| 124 | */ |
|
| 125 | public function hydrate(string $class, array $json): ResourceInterface |
|
| 126 | { |
|
| 127 | $fullClassName = implode( |
|
| 128 | '\\', |
|
| 129 | [ |
|
| 130 | $this->options[Options::NAMESPACE], |
|
| 131 | $this->options[Options::NAMESPACE_SUFFIX], |
|
| 132 | $class, |
|
| 133 | ] |
|
| 134 | ); |
|
| 135 | return $this->hydrateFQCN($fullClassName, $json); |
|
| 136 | } |
|
| 137 | ||
| 138 | /** |
|
| 139 | * @param string $class |
|
| @@ 240-251 (lines=12) @@ | ||
| 237 | * @param ResourceInterface $object |
|
| 238 | * @return array |
|
| 239 | */ |
|
| 240 | public function extract(string $class, ResourceInterface $object): array |
|
| 241 | { |
|
| 242 | $fullClassName = implode( |
|
| 243 | '\\', |
|
| 244 | [ |
|
| 245 | $this->options[Options::NAMESPACE], |
|
| 246 | $this->options[Options::NAMESPACE_SUFFIX], |
|
| 247 | $class, |
|
| 248 | ] |
|
| 249 | ); |
|
| 250 | return $this->extractFQCN($fullClassName, $object); |
|
| 251 | } |
|
| 252 | ||
| 253 | /** |
|
| 254 | * Takes a fully qualified class name and extracts the data for that class from the given $object |
|