Yoast\WP\Lib

Model::has_many()protectedYoast 1.0

Helper method to manage one-to-many relations where the foreign key is on the associated table.

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

Хуков нет.

Возвращает

ORM. Instance of the ORM.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->has_many( $associated_class_name, $foreign_key_name, $foreign_key_name_in_current_models_table );
$associated_class_name(строка) (обязательный)
The associated class name.
$foreign_key_name(строка|null)
The foreign key name in the associated table.
По умолчанию: null
$foreign_key_name_in_current_models_table(строка|null)
The foreign key in the current models table.
По умолчанию: null

Код Model::has_many() Yoast 24.0

protected function has_many( $associated_class_name, $foreign_key_name = null, $foreign_key_name_in_current_models_table = null ) {
	$this->set_table_name( $associated_class_name );

	return $this->has_one_or_many( $associated_class_name, $foreign_key_name, $foreign_key_name_in_current_models_table );
}