Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function hydrate(AbstractEntity $entity, AbstractProperty $property)
 {
     $entries = isset($this->entries[$entity->getType()][$entity->getId()][$property->getId()]) ? $this->entries[$entity->getType()][$entity->getId()][$property->getId()] : array();
     $value = $this->relationshipCollection->createChildCollection($entries);
     $entity->setAttribute($property->getName(), $value);
     return $value;
 }
Exemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function hydrate(AbstractEntity $entity, AbstractProperty $property)
 {
     if (isset($this->selections[$entity->getType()][$entity->getId()][$property->getId()])) {
         $value = $this->selections[$entity->getType()][$entity->getId()][$property->getId()];
     } else {
         $value = new AssetCollection();
     }
     $entity->setAttribute($property->getName(), $value);
     return $value;
 }