Source

						protected function _fromRelationship($rel) {
		$model = $rel->to();
		$name = $rel->name();
		$type = $rel->type();
		$fieldName = $rel->fieldName();
		$this->_config['relationships'][$name] = compact('type', 'model', 'fieldName');

		$constraint = $rel->constraints();
		$class = get_class($this);

		return array($name, $this->_instance($class, compact('constraint', 'model') + array(
			'type' => 'LEFT',
			'alias' => $rel->name()
		)));
	}