Yoast\WP\Lib

ORM::create_instance_from_row()protectedYoast 1.0

Creates an ORM instance from the given row (an associative array of data fetched from the database).

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

Хуков нет.

Возвращает

true|false|Model.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->create_instance_from_row( $row );
$row(массив) (обязательный)
A row from the database.

Код ORM::create_instance_from_row() Yoast 22.4

protected function create_instance_from_row( $row ) {
	$instance = self::for_table( $this->table_name );
	$instance->use_id_column( $this->instance_id_column );
	$instance->hydrate( $row );

	return $this->create_model_instance( $instance );
}