@@ 72-83 (lines=12) @@ | ||
69 | * @param array $json |
|
70 | * @return ResourceInterface |
|
71 | */ |
|
72 | public function hydrate(string $class, array $json): ResourceInterface |
|
73 | { |
|
74 | $fullClassName = implode( |
|
75 | '\\', |
|
76 | [ |
|
77 | $this->options[Options::NAMESPACE], |
|
78 | $this->options[Options::NAMESPACE_SUFFIX], |
|
79 | $class, |
|
80 | ] |
|
81 | ); |
|
82 | return $this->hydrateFQCN($fullClassName, $json); |
|
83 | } |
|
84 | ||
85 | /** |
|
86 | * @param string $class |
|
@@ 126-137 (lines=12) @@ | ||
123 | * @param ResourceInterface $object |
|
124 | * @return array |
|
125 | */ |
|
126 | public function extract(string $class, ResourceInterface $object): array |
|
127 | { |
|
128 | $fullClassName = implode( |
|
129 | '\\', |
|
130 | [ |
|
131 | $this->options[Options::NAMESPACE], |
|
132 | $this->options[Options::NAMESPACE_SUFFIX], |
|
133 | $class, |
|
134 | ] |
|
135 | ); |
|
136 | return $this->extractFQCN($fullClassName, $object); |
|
137 | } |
|
138 | ||
139 | /** |
|
140 | * Takes a fully qualified class name and extracts the data for that class from the given $object |