Yoast\WP\Lib

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 22.4

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;
}