src/ActiveDoctrine/Entity/Entity.php
/**
     * Fetch a related entity from the database.
     *
     * @param array $relation The relation to fetch.
     */
Fetch a related entity from the database.
@param array $relation The relation to fetch.
Fetch a related entity from the database . @param array $relation The relation to fetch .
protected function fetchRelation(array $relation)
    {
        list($type, $foreign_class, $foreign_column, $column) = $relation;
        switch ($type) {
        case 'has_one':
            return $this->fetchOneToOne($foreign_class, $foreign_column, $column);
        case 'belongs_to':
            return $this->fetchOneToOne($foreign_class, $foreign_column, $column);
        case 'has_many':
            return $this->fetchOneToMany($foreign_class, $foreign_column, $column);
        default:
        }
    }
protected function fetchRelation ( array $ relation ) { list ( $ type , $ foreign_class , $ foreign_column , $ column ) = $ relation ; switch ( $ type ) { case 'has_one' : return $ this -> fetchOneToOne ( $ foreign_class , $ foreign_column , $ column ) ; case 'belongs_to' : return $ this -> fetchOneToOne ( $ foreign_class , $ foreign_column , $ column ) ; case 'has_many' : return $ this -> fetchOneToMany ( $ foreign_class , $ foreign_column , $ column ) ; default : } }
Fetch a related entity from the database.
Fetch a related entity from the database .
/* a relation is of the form
         * [$type, $foreign_class, $foreign_column, $column]
         */