Model::build_foreign_key_name()protected staticYoast 1.0

Build a foreign key based on a table name. If the first argument (the specified foreign key column name) is null, returns the second argument (the name of the table) with the default foreign key column suffix appended.

Метод класса: Model{}

Хуков нет.


Строку. The built foreign key name.


$result = Model::build_foreign_key_name( $specified_foreign_key_name, $table_name );
$specified_foreign_key_name(строка) (обязательный)
The keyname to build.
$table_name(строка) (обязательный)
The table name to build the key name for.

Код Model::build_foreign_key_name() Yoast 19.14

protected static function build_foreign_key_name( $specified_foreign_key_name, $table_name ) {
	if ( $specified_foreign_key_name !== null ) {
		return $specified_foreign_key_name;

	return $table_name . static::DEFAULT_FOREIGN_KEY_SUFFIX;