@@ 130-141 (lines=12) @@ | ||
127 | * @param array $json |
|
128 | * @return CancellablePromiseInterface |
|
129 | */ |
|
130 | public function hydrate(string $class, array $json): CancellablePromiseInterface |
|
131 | { |
|
132 | $fullClassName = implode( |
|
133 | '\\', |
|
134 | [ |
|
135 | $this->options[Options::NAMESPACE], |
|
136 | $this->options[Options::NAMESPACE_SUFFIX], |
|
137 | $class, |
|
138 | ] |
|
139 | ); |
|
140 | return $this->hydrateFQCN($fullClassName, $json); |
|
141 | } |
|
142 | ||
143 | /** |
|
144 | * @param string $class |
|
@@ 218-229 (lines=12) @@ | ||
215 | * @param ResourceInterface $object |
|
216 | * @return CancellablePromiseInterface |
|
217 | */ |
|
218 | public function extract(string $class, ResourceInterface $object): CancellablePromiseInterface |
|
219 | { |
|
220 | $fullClassName = implode( |
|
221 | '\\', |
|
222 | [ |
|
223 | $this->options[Options::NAMESPACE], |
|
224 | $this->options[Options::NAMESPACE_SUFFIX], |
|
225 | $class, |
|
226 | ] |
|
227 | ); |
|
228 | return $this->extractFQCN($fullClassName, $object); |
|
229 | } |
|
230 | ||
231 | /** |
|
232 | * Takes a fully qualified class name and extracts the data for that class from the given $object |