Exemplo n.º 1
0
 private function fetchComposedEntity(Entity $entity, EntityField $entityField)
 {
     if ($entityField->isJoinedEntity()) {
         $entity->setParameterValue($entityField->getParameterName(), $this->fetchJoinedCompositeEntity($entityField->getCompositeEntity(), $entity->getParameterValue($entityField->getParameterName())));
     } else {
         if ($entityField->isMappedEntity()) {
             if ($entityField->getRelation() === "oneToMany" || $entityField->getRelation() === "manyToMany") {
                 $entity->setParameterValue($entityField->getParameterName(), $this->fetchMappedCompositeEntities($entityField, $entity->getIdValue()));
             } else {
                 if ($entityField->getRelation() === "oneToOne" || $entityField->getRelation() === "ManyToOne") {
                     $entity->setParameterValue($entityField->getParameterName(), $this->fetchMappedCompositeEntity($entityField, $entity->getIdValue()));
                 }
             }
         }
     }
 }