Yoast\WP\Lib

ORM::create()publicYoast 1.0

Creates a new, empty instance of the class. Used to add a new row to your database. May optionally be passed an associative array of data to populate the instance. If so, all fields will be flagged as dirty so all will be saved to the database when save() is called.

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

Хуков нет.

Возвращает

true|false|Model|ORM.

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

$ORM = new ORM();
$ORM->create( $data );
$data(массив|null)
Data to populate table.
По умолчанию: null

Код ORM::create() Yoast 22.4

public function create( $data = null ) {
	$this->is_new = true;
	if ( ! \is_null( $data ) ) {
		$this->hydrate( $data )->force_all_dirty();
	}

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