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