Yoast\WP\Lib
ORM::update_many() public Yoast 1.0
Updates many records in the database.
{} Это метод класса: ORM{}
Хуков нет.
Возвращает
Число/true/false. The number of rows changed if the query was succesful. False otherwise.
Использование
$ORM = new ORM(); $ORM->update_many();
Код ORM::update_many() ORM::update many Yoast 15.9
public function update_many() {
// Remove any expression fields as they are already baked into the query.
$values = \array_values( \array_diff_key( $this->dirty_fields, $this->expr_fields ) );
// UPDATE.
// If there are no dirty values, do nothing.
if ( empty( $values ) && empty( $this->expr_fields ) ) {
return true;
}
$query = $this->join_if_not_empty( ' ', [ $this->build_update(), $this->build_where() ] );
$success = self::execute( $query, \array_merge( $values, $this->values ) );
$this->dirty_fields = [];
$this->expr_fields = [];
return $success;
}