| @@ 65-76 (lines=12) @@ | ||
| 62 | * @param array $json |
|
| 63 | * @return ResourceInterface |
|
| 64 | */ |
|
| 65 | public function hydrate(string $class, array $json): ResourceInterface |
|
| 66 | { |
|
| 67 | $fullClassName = implode( |
|
| 68 | '\\', |
|
| 69 | [ |
|
| 70 | $this->options[Options::NAMESPACE], |
|
| 71 | $this->options[Options::NAMESPACE_SUFFIX], |
|
| 72 | $class, |
|
| 73 | ] |
|
| 74 | ); |
|
| 75 | return $this->hydrateFQCN($fullClassName, $json); |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * @param string $class |
|
| @@ 115-126 (lines=12) @@ | ||
| 112 | * @param ResourceInterface $object |
|
| 113 | * @return array |
|
| 114 | */ |
|
| 115 | public function extract(string $class, ResourceInterface $object): array |
|
| 116 | { |
|
| 117 | $fullClassName = implode( |
|
| 118 | '\\', |
|
| 119 | [ |
|
| 120 | $this->options[Options::NAMESPACE], |
|
| 121 | $this->options[Options::NAMESPACE_SUFFIX], |
|
| 122 | $class, |
|
| 123 | ] |
|
| 124 | ); |
|
| 125 | return $this->extractFQCN($fullClassName, $object); |
|
| 126 | } |
|
| 127 | ||
| 128 | /** |
|
| 129 | * Takes a fully qualified class name and extracts the data for that class from the given $object |
|