src/Database/ORM/Traits/Relationships.php
/**
	 * This model is associated with multiple models through a map table.
	 *
	 * @param string $model
	 * @param string $mapTable
	 * @param string $localKey
	 * @param string $parentKey
	 * @return BelongsToManyRelationship
	 */
This model is associated with multiple models through a map table.
This model is associated with multiple models through a map table .
protected function belongsToMany($model, $mapTable = null, $localKey = null, $parentKey = null) {
		if (is_null($localKey)) {
			$localKey = StringBuilder::getSingularModelName($this) . '_' . $this->getPrimaryKey();
		}
		if (is_null($parentKey)) {
			$o = new $model();
			$parentKey = StringBuilder::getSingularModelName($model) . '_' . $o->getPrimaryKey();
			unset($o);
		}
		return new BelongsToManyRelationship($this, $model, $parentKey, $localKey, $mapTable);
	}
protected function belongsToMany ( $ model , $ mapTable = null , $ localKey = null , $ parentKey = null ) { if ( is_null ( $ localKey ) ) { $ localKey = StringBuilder :: getSingularModelName ( $ this ) . '_' . $ this -> getPrimaryKey ( ) ; } if ( is_null ( $ parentKey ) ) { $ o = new $ model ( ) ; $ parentKey = StringBuilder :: getSingularModelName ( $ model ) . '_' . $ o -> getPrimaryKey ( ) ; unset ( $ o ) ; } return new BelongsToManyRelationship ( $ this , $ model , $ parentKey , $ localKey , $ mapTable ) ; }
This model is associated with multiple models through a map table.
This model is associated with multiple models through a map table .