public function hasRelation($name, $embedded = null)
    {
        if (!isset($this->_relations[$name])) {
            return false;
        }
        $relation = $this->_relations[$name];
        if ($embedded === null) {
            return true;
        }
        return $embedded === $relation['embedded'];
    }
public function hasRelation($name, $embedded = null)
    {
        if (!isset($this->_relations[$name])) {
            return false;
        }
        $relation = $this->_relations[$name];
        if ($embedded === null) {
            return true;
        }
        return $embedded === $relation['embedded'];
    }
public function hasRelation ( $ name , $ embedded = null ) { if ( ! isset ( $ this -> _relations [ $ name ] ) ) { return false ; } $ relation = $ this -> _relations [ $ name ] ; if ( $ embedded === null ) { return true ; } return $ embedded === $ relation [ 'embedded' ] ; }
Checks if a relation exists.

@param  string  $name     The name of a relation.
@param  boolean $embedded Check for embedded relations or not. `null` means indifferent, `true` means embedded only
and `false` mean external only.
@return boolean           Returns `true` if the relation exists, `false` otherwise.
Checks if a relation exists .