| @@ 85-96 (lines=12) @@ | ||
| 82 | * @param array $json |
|
| 83 | * @return ResourceInterface |
|
| 84 | */ |
|
| 85 | public function hydrate(string $class, array $json): ResourceInterface |
|
| 86 | { |
|
| 87 | $fullClassName = implode( |
|
| 88 | '\\', |
|
| 89 | [ |
|
| 90 | $this->options[Options::NAMESPACE], |
|
| 91 | $this->options[Options::NAMESPACE_SUFFIX], |
|
| 92 | $class, |
|
| 93 | ] |
|
| 94 | ); |
|
| 95 | return $this->hydrateFQCN($fullClassName, $json); |
|
| 96 | } |
|
| 97 | ||
| 98 | /** |
|
| 99 | * @param string $class |
|
| @@ 139-150 (lines=12) @@ | ||
| 136 | * @param ResourceInterface $object |
|
| 137 | * @return array |
|
| 138 | */ |
|
| 139 | public function extract(string $class, ResourceInterface $object): array |
|
| 140 | { |
|
| 141 | $fullClassName = implode( |
|
| 142 | '\\', |
|
| 143 | [ |
|
| 144 | $this->options[Options::NAMESPACE], |
|
| 145 | $this->options[Options::NAMESPACE_SUFFIX], |
|
| 146 | $class, |
|
| 147 | ] |
|
| 148 | ); |
|
| 149 | return $this->extractFQCN($fullClassName, $object); |
|
| 150 | } |
|
| 151 | ||
| 152 | /** |
|
| 153 | * Takes a fully qualified class name and extracts the data for that class from the given $object |
|