public function getRelation($name, $use_alias = false)
    {
        if ($use_alias) {
            foreach ($this->relations as $relation) {
                if (0 === strcasecmp($name, $relation->getName($use_alias))) {
                    return $relation;
                }
            }
        } else {
            $key = strtolower($name);
            if (isset($this->relations[$key])) {
                return $this->relations[$key];
            }
        }

        return null;
    }
public function getRelation($name, $use_alias = false)
    {
        if ($use_alias) {
            foreach ($this->relations as $relation) {
                if (0 === strcasecmp($name, $relation->getName($use_alias))) {
                    return $relation;
                }
            }
        } else {
            $key = strtolower($name);
            if (isset($this->relations[$key])) {
                return $this->relations[$key];
            }
        }

        return null;
    }
public function getRelation ( $ name , $ use_alias = false ) { if ( $ use_alias ) { foreach ( $ this -> relations as $ relation ) { if ( 0 === strcasecmp ( $ name , $ relation -> getName ( $ use_alias ) ) ) { return $ relation ; } } } else { $ key = strtolower ( $ name ) ; if ( isset ( $ this -> relations [ $ key ] ) ) { return $ this -> relations [ $ key ] ; } } return null ; }
Gets the named relation metadata.

@param string $name relation name
@param bool   $use_alias

@return RelationSchema metadata of the named relation. Null if the named relation does not exist.
Gets the named relation metadata .