| @@ 116-127 (lines=12) @@ | ||
| 113 | * @param array $json |
|
| 114 | * @return ResourceInterface |
|
| 115 | */ |
|
| 116 | public function hydrate(string $class, array $json): ResourceInterface |
|
| 117 | { |
|
| 118 | $fullClassName = implode( |
|
| 119 | '\\', |
|
| 120 | [ |
|
| 121 | $this->options[Options::NAMESPACE], |
|
| 122 | $this->options[Options::NAMESPACE_SUFFIX], |
|
| 123 | $class, |
|
| 124 | ] |
|
| 125 | ); |
|
| 126 | return $this->hydrateFQCN($fullClassName, $json); |
|
| 127 | } |
|
| 128 | ||
| 129 | /** |
|
| 130 | * @param string $class |
|
| @@ 170-181 (lines=12) @@ | ||
| 167 | * @param ResourceInterface $object |
|
| 168 | * @return array |
|
| 169 | */ |
|
| 170 | public function extract(string $class, ResourceInterface $object): array |
|
| 171 | { |
|
| 172 | $fullClassName = implode( |
|
| 173 | '\\', |
|
| 174 | [ |
|
| 175 | $this->options[Options::NAMESPACE], |
|
| 176 | $this->options[Options::NAMESPACE_SUFFIX], |
|
| 177 | $class, |
|
| 178 | ] |
|
| 179 | ); |
|
| 180 | return $this->extractFQCN($fullClassName, $object); |
|
| 181 | } |
|
| 182 | ||
| 183 | /** |
|
| 184 | * Takes a fully qualified class name and extracts the data for that class from the given $object |
|