Yoast\WP\Lib

ORM::build_insert()protectedYoast 1.0

Builds an INSERT query.

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

Хуков нет.

Возвращает

Строку. The insert query.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->build_insert();

Код ORM::build_insert() Yoast 22.4

protected function build_insert() {
	$query        = [];
	$query[]      = 'INSERT INTO';
	$query[]      = $this->quote_identifier( $this->table_name );
	$field_list   = \array_map( [ $this, 'quote_identifier' ], \array_keys( $this->dirty_fields ) );
	$query[]      = '(' . \implode( ', ', $field_list ) . ')';
	$query[]      = 'VALUES';
	$placeholders = $this->create_placeholders( $this->dirty_fields );
	$query[]      = "({$placeholders})";

	return \implode( ' ', $query );
}