public static function relations($type = null) {
		$self = static::_object();

		if ($type === null) {
			return static::_relations();
		}
		if (isset($self->_relationFieldNames[$type])) {
			$type = $self->_relationFieldNames[$type];
		}

		if (isset($self->_relations[$type])) {
			return $self->_relations[$type];
		}
		if (isset($self->_relationsToLoad[$type])) {
			return static::_relations(null, $type);
		}
		if (in_array($type, $self->_relationTypes, true)) {
			return array_keys(static::_relations($type));
		}
	}
public static function relations($type = null) {
		$self = static::_object();

		if ($type === null) {
			return static::_relations();
		}
		if (isset($self->_relationFieldNames[$type])) {
			$type = $self->_relationFieldNames[$type];
		}

		if (isset($self->_relations[$type])) {
			return $self->_relations[$type];
		}
		if (isset($self->_relationsToLoad[$type])) {
			return static::_relations(null, $type);
		}
		if (in_array($type, $self->_relationTypes, true)) {
			return array_keys(static::_relations($type));
		}
	}
public static function relations ( $ type = null ) { $ self = static :: _object ( ) ; if ( $ type === null ) { return static :: _relations ( ) ; } if ( isset ( $ self -> _relationFieldNames [ $ type ] ) ) { $ type = $ self -> _relationFieldNames [ $ type ] ; } if ( isset ( $ self -> _relations [ $ type ] ) ) { return $ self -> _relations [ $ type ] ; } if ( isset ( $ self -> _relationsToLoad [ $ type ] ) ) { return static :: _relations ( null , $ type ) ; } if ( in_array ( $ type , $ self -> _relationTypes , true ) ) { return array_keys ( static :: _relations ( $ type ) ) ; } }
Returns a list of models related to `Model`, or a list of models related
to this model, but of a certain type.

@param string $type A type of model relation.
@return array|object|void An array of relation instances or an instance of relation.
Returns a list of models related to Model or a list of models related to this model but of a certain type .