public static function bind($type, $name, array $config = []) {
		$self = static::_object();
		if (!isset($config['fieldName'])) {
			$config['fieldName'] = $self->_relationFieldName($type, $name);
		}

		if (!in_array($type, $self->_relationTypes)) {
			throw new ConfigException("Invalid relationship type `{$type}` specified.");
		}
		$self->_relationFieldNames[$config['fieldName']] = $name;
		$rel = static::connection()->relationship(get_called_class(), $type, $name, $config);
		return $self->_relations[$name] = $rel;
	}
public static function bind($type, $name, array $config = []) {
		$self = static::_object();
		if (!isset($config['fieldName'])) {
			$config['fieldName'] = $self->_relationFieldName($type, $name);
		}

		if (!in_array($type, $self->_relationTypes)) {
			throw new ConfigException("Invalid relationship type `{$type}` specified.");
		}
		$self->_relationFieldNames[$config['fieldName']] = $name;
		$rel = static::connection()->relationship(get_called_class(), $type, $name, $config);
		return $self->_relations[$name] = $rel;
	}
public static function bind ( $ type , $ name , array $ config = [ ] ) { $ self = static :: _object ( ) ; if ( ! isset ( $ config [ 'fieldName' ] ) ) { $ config [ 'fieldName' ] = $ self -> _relationFieldName ( $ type , $ name ) ; } if ( ! in_array ( $ type , $ self -> _relationTypes ) ) { throw new ConfigException ( "Invalid relationship type `{$type}` specified." ) ; } $ self -> _relationFieldNames [ $ config [ 'fieldName' ] ] = $ name ; $ rel = static :: connection ( ) -> relationship ( get_called_class ( ) , $ type , $ name , $ config ) ; return $ self -> _relations [ $ name ] = $ rel ; }
Creates a relationship binding between this model and another.

@see lithium\data\model\Relationship
@param string $type The type of relationship to create. Must be one of `'hasOne'`,
`'hasMany'` or `'belongsTo'`.
@param string $name The name of the relationship. If this is also the name of the model,
the model must be in the same namespace as this model. Otherwise, the
fully-namespaced path to the model class must be specified in `$config`.
@param array $config Any other configuration that should be specified in the relationship.
See the `Relationship` class for more information.
@return object Returns an instance of the `Relationship` class that defines the connection.
Creates a relationship binding between this model and another .