Yoast\WP\Lib

Model::has_one()protectedYoast 1.0

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

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

Хуков нет.

Возвращает

ORM. Instance of the ORM.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->has_one( $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_one() Yoast 22.4

protected function has_one( $associated_class_name, $foreign_key_name = null, $foreign_key_name_in_current_models_table = null ) {
	return $this->has_one_or_many( $associated_class_name, $foreign_key_name, $foreign_key_name_in_current_models_table );
}