コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function loadMetadata()
 {
     $factory = new SerializationClassMetadataFactory();
     $cache = $this->getMetadataCache();
     $collection = new SerializationMetadataCollection();
     foreach ($cache as $className => $parameters) {
         $metadata = $factory->create($className, $parameters);
         $collection->add($metadata);
     }
     return $collection;
 }
コード例 #2
0
 /**
  * Returns the serialization metadata for given entity
  *
  * @param object $entity
  *
  * @return \WellCommerce\Bundle\ApiBundle\Metadata\SerializationClassMetadataInterface
  */
 protected function getSerializationMetadata($entity)
 {
     $className = $this->getRealClass($entity);
     return $this->serializationMetadataCollection->get($className);
 }