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