Beispiel #1
0
 public function deserialize($data, $type, $format)
 {
     $visitor = $this->getDeserializationVisitor($format);
     $visitor->setNavigator($navigator = new GraphNavigator(GraphNavigator::DIRECTION_DESERIALIZATION, $this->factory, $this->exclusionStrategy));
     $navigator->accept($visitor->prepare($data), $type, $visitor);
     return $visitor->getResult();
 }
 public function deserialize($data, $type, $format)
 {
     $visitor = $this->getDeserializationVisitor($format);
     $visitor->setNavigator($navigator = new GraphNavigator(GraphNavigator::DIRECTION_DESERIALIZATION, $this->factory, $format, $this->handlerRegistry, $this->objectConstructor, $this->exclusionStrategy, $this->dispatcher));
     $navigatorResult = $navigator->accept($visitor->prepare($data), $this->typeParser->parse($type), $visitor);
     // This is a special case if the root is handled by a callback on the object iself.
     if (null === ($visitorResult = $visitor->getResult()) && null !== $navigatorResult) {
         return $navigatorResult;
     }
     return $visitorResult;
 }