protected function doUnserialize($var, $class, Hydrators $hydrators) { $handler = $hydrators->getHandler($class); if (null === $handler) { throw new \RuntimeException(sprintf('No unserialization handler for class %s!', $class)); } return call_user_func_array($handler, array($var, $hydrators)); }
public function unserialize($var, $class, Hydrators $hydrators) { $doc = new \DOMDocument(); $doc->loadXML($var); $data = $this->parse($doc, $doc); $hydrator = $hydrators->getHandler($class); return $hydrator($data[$hydrators->getRoot($class)], $hydrators); }