Exemple #1
0
 /**
  * Fetch target entity or entities.
  *
  * @param Entity $entity
  * @return mixed
  */
 public function solveFetch(Entity &$entity)
 {
     // We need to find all target entities with the ID defined in the current entity source column
     $column = $this->relation->join->column;
     $value = $entity->{$column};
     $where = array($this->relation->join->targetColumn => $value);
     $query = EntityManager::find($this->relation->targetEntity);
     return $query->where($where)->all();
 }