public function getRelation($name)
    {
        if (!isset($this->relationships)) {
            $relations = $this->getRelations();
        } else {
            $relations = $this->relationships;
        }

        foreach ($relations as $relation) {
            if ($relation->getAlias() == $name) {
                return $relation;
            }
        }
        return false;
    }
public function getRelation($name)
    {
        if (!isset($this->relationships)) {
            $relations = $this->getRelations();
        } else {
            $relations = $this->relationships;
        }

        foreach ($relations as $relation) {
            if ($relation->getAlias() == $name) {
                return $relation;
            }
        }
        return false;
    }
public function getRelation ( $ name ) { if ( ! isset ( $ this -> relationships ) ) { $ relations = $ this -> getRelations ( ) ; } else { $ relations = $ this -> relationships ; } foreach ( $ relations as $ relation ) { if ( $ relation -> getAlias ( ) == $ name ) { return $ relation ; } } return false ; }
get a particular relationship configured for this model

@param $name
@return mixed either a relationship object or false
get a particular relationship configured for this model