src/Database/QueryBuilder/StringBuilder.php
/**
	 * Computes the name of a mapping table to form a many-to-many relationship. Expects the fully-qualified names of
	 * model classes. Always returns the tables in alphabetical order (first in alphabet = first in map table name).
	 *
	 * @param string $singular
	 * @param string $plural
	 * @return string
	 */
Computes the name of a mapping table to form a many-to-many relationship. Expects the fully-qualified names of
model classes. Always returns the tables in alphabetical order (first in alphabet = first in map table name).


Computes the name of a mapping table to form a many - to - many relationship . Expects the fully - qualified names of model classes . Always returns the tables in alphabetical order ( first in alphabet = first in map table name ) .
public static function generateMappingTableName($model, $relatedModel) {
		$names = array($model, $relatedModel);
		foreach ($names as $i => $value) {
			$model = strtolower(substr(strrchr($value, '\\'), 1));
			if (substr($model, -1) == 's') {
				$model = substr($model, 0, -1);
			}
			$names[$i] = $model;
		}
		sort($names);
		return implode('_', $names);
	}
public static function generateMappingTableName ( $ model , $ relatedModel ) { $ names = array ( $ model , $ relatedModel ) ; foreach ( $ names as $ i => $ value ) { $ model = strtolower ( substr ( strrchr ( $ value , '\\' ) , 1 ) ) ; if ( substr ( $ model , - 1 ) == 's' ) { $ model = substr ( $ model , 0 , - 1 ) ; } $ names [ $ i ] = $ model ; } sort ( $ names ) ; return implode ( '_' , $ names ) ; }
Computes the name of a mapping table to form a many-to-many relationship.
Computes the name of a mapping table to form a many - to - many relationship .