src/Titon/Model/Model.php
public function getRelations($type = null) {
        if (!$type) {
            return $this->_relations;
        }

        $relations = [];

        foreach ($this->_relations as $relation) {
            if ($relation->getType() === $type) {
                $relations[$relation->getAlias()] = $relation;
            }
        }

        return $relations;
    }
public function getRelations($type = null) {
        if (!$type) {
            return $this->_relations;
        }

        $relations = [];

        foreach ($this->_relations as $relation) {
            if ($relation->getType() === $type) {
                $relations[$relation->getAlias()] = $relation;
            }
        }

        return $relations;
    }
public function getRelations ( $ type = null ) { if ( ! $ type ) { return $ this -> _relations ; } $ relations = [ ] ; foreach ( $ this -> _relations as $ relation ) { if ( $ relation -> getType ( ) === $ type ) { $ relations [ $ relation -> getAlias ( ) ] = $ relation ; } } return $ relations ; }
Return all relations, or all relations by type.

@param string $type
@return \Titon\Model\Relation[]
Return all relations or all relations by type .