121 public static function updateBatch(array $fields, array $filter): void
123 $tableName = static::getTableName();
125 $sqlHelper = $connection->getSqlHelper();
127 $update = $sqlHelper->prepareUpdate($tableName, $fields);
129 $query =
new Query(static::getEntity());
130 $query->setFilter($filter);
133 $alias = $sqlHelper->quote($query->getInitAlias()) .
'.';
134 $where = str_replace($alias,
'', $query->getWhere());
136 $sql =
'UPDATE ' . $tableName .
' SET ' . $update[0] .
' WHERE ' . $where;
137 $connection->queryExecute($sql, $update[1]);