/** * Deserialize the resource from the specified input stream. * * @param string $incoming The text to deserialize. * * @return mixed the resource. */ public function deserialize($incoming) { $resources = null; $json = json_decode($incoming); foreach ($json as $key => $value) { if (JsonMapper::isKnownType($key)) { $class = XmlMapper::getClassName($key); $resources[] = new $class($value); } } return $resources; }