Yoast\WP\Lib
ORM::build_insert
Builds an INSERT query.
Метод класса: ORM{}
Хуков нет.
Возвращает
string. The insert query.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->build_insert();
Код ORM::build_insert() ORM::build insert Yoast 28.9
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 );
}