public function relationships($relpath = null, $config = null) {
		if ($config) {
			if (!$relpath) {
				throw new InvalidArgumentException("The relation dotted path is empty.");
			}
			if (isset($config['model']) && isset($config['alias'])) {
				$this->_models[$config['alias']] = $config['model'];
			}
			$this->_config['relationships'][$relpath] = $config;
			return $this;
		}
		if (!$relpath) {
			return $this->_config['relationships'];
		}
		if (isset($this->_config['relationships'][$relpath])) {
			return $this->_config['relationships'][$relpath];
		}
	}
public function relationships($relpath = null, $config = null) {
		if ($config) {
			if (!$relpath) {
				throw new InvalidArgumentException("The relation dotted path is empty.");
			}
			if (isset($config['model']) && isset($config['alias'])) {
				$this->_models[$config['alias']] = $config['model'];
			}
			$this->_config['relationships'][$relpath] = $config;
			return $this;
		}
		if (!$relpath) {
			return $this->_config['relationships'];
		}
		if (isset($this->_config['relationships'][$relpath])) {
			return $this->_config['relationships'][$relpath];
		}
	}
public function relationships ( $ relpath = null , $ config = null ) { if ( $ config ) { if ( ! $ relpath ) { throw new InvalidArgumentException ( "The relation dotted path is empty." ) ; } if ( isset ( $ config [ 'model' ] ) && isset ( $ config [ 'alias' ] ) ) { $ this -> _models [ $ config [ 'alias' ] ] = $ config [ 'model' ] ; } $ this -> _config [ 'relationships' ] [ $ relpath ] = $ config ; return $ this ; } if ( ! $ relpath ) { return $ this -> _config [ 'relationships' ] ; } if ( isset ( $ this -> _config [ 'relationships' ] [ $ relpath ] ) ) { return $ this -> _config [ 'relationships' ] [ $ relpath ] ; } }
Set and get the relationships.

@param string $relpath A dotted path.
@param array $config the config array to set.
@return mixed The relationships array or a relationship array if `$relpath` is set. Returns
`null` if a join doesn't exist.
@throws InvalidArgumentException
Set and get the relationships .