コード例 #1
0
 /**
  * @param PreDeserializeEvent $event
  */
 public function onSerializerPreDeserialize(PreDeserializeEvent $event)
 {
     if ($this->transformer->isResourcePath($event->getData()) && $this->transformer->isResource($event->getType()['name'])) {
         $event->setType($this->typeNameStrict, [$this->originalTypeParamName => $event->getType()['name']]);
         return;
     }
     //  @JMS\Type("array<CLASSNAME>")
     if (is_array($event->getData()) && $this->containsResources($event->getData()) && isset($event->getType()['params'][0]['name']) && $this->transformer->isResource($event->getType()['params'][0]['name'])) {
         $event->setType($event->getType()['name'], [['name' => $this->typeNameStrict, 'params' => [$this->originalTypeParamName => $event->getType()['params'][0]['name']]]]);
     }
 }
コード例 #2
0
 public function supports(ParamConverter $configuration)
 {
     return $this->resourceTransformer->isResource($configuration->getClass());
 }