aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Category
diff options
context:
space:
mode:
authorAmir Sarabadani <ladsgroup@gmail.com>2023-02-15 21:10:05 +0100
committerAmir Sarabadani <ladsgroup@gmail.com>2023-02-23 15:04:22 +0100
commit3102b7f8019b507abb1c129043d0e55d7613f346 (patch)
tree991c7cfe10b1b03b465e5ef0f7ec4f11b47c89fb /includes/Category
parentece5dace754460204a47d9e920213d685d656417 (diff)
downloadmediawikicore-3102b7f8019b507abb1c129043d0e55d7613f346.tar.gz
mediawikicore-3102b7f8019b507abb1c129043d0e55d7613f346.zip
rdbms: Introduce UpdateQueryBuilder
And using in Category.php as a POC. Bug: T329790 Change-Id: Iab0da74508baf7f07bae8f0e2d039e12bb4206a9
Diffstat (limited to 'includes/Category')
-rw-r--r--includes/Category/Category.php13
1 files changed, 6 insertions, 7 deletions
diff --git a/includes/Category/Category.php b/includes/Category/Category.php
index d290f532babe..84d62a623387 100644
--- a/includes/Category/Category.php
+++ b/includes/Category/Category.php
@@ -418,16 +418,15 @@ class Category {
# The category row already exists, so do a plain UPDATE instead
# of INSERT...ON DUPLICATE KEY UPDATE to avoid creating a gap
# in the cat_id sequence. The row may or may not be "affected".
- $dbw->update(
- 'category',
- [
+ $dbw->newUpdateQueryBuilder()
+ ->update( 'category' )
+ ->set( [
'cat_pages' => $result->pages,
'cat_subcats' => $result->subcats,
'cat_files' => $result->files
- ],
- [ 'cat_title' => $this->mName ],
- __METHOD__
- );
+ ] )
+ ->where( [ 'cat_title' => $this->mName ] )
+ ->caller( __METHOD__ )->execute();
} else {
# The category is empty and has no description page, delete it
$dbw->delete(