X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FCategory.php;h=f8ac8aeb59d1ccdca3a90e75550a959a09dfaef5;hb=4aa6454d454df807059db5e794ef620896ff2e3d;hp=2cf44b86f8a459f7e96ba0c58239c28045e0eddf;hpb=c4568ad41b7a1d6ba6669812529cddfe2b1e455a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Category.php b/includes/Category.php index 2cf44b86f8..f8ac8aeb59 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -48,7 +48,7 @@ class Category { /** * Set up all member variables using a database query. - * @param int $mode + * @param int $mode One of (Category::LOAD_ONLY, Category::LAZY_INIT_ROW) * @throws MWException * @return bool True on success, false on failure. */ @@ -171,7 +171,7 @@ class Category { * fields are null, the resulting Category object will represent an empty * category if a title object was given. If the fields are null and no * title was given, this method fails and returns false. - * @param Title $title Optional title object for the category represented by + * @param Title|null $title Optional title object for the category represented by * the given row. May be provided if it is already known, to avoid having * to re-create a title object later. * @return Category|false @@ -337,13 +337,7 @@ class Category { // Lock the `category` row before locking `categorylinks` rows to try // to avoid deadlocks with LinksDeletionUpdate (T195397) - $dbw->selectField( - 'category', - 1, - [ 'cat_title' => $this->mName ], - __METHOD__, - [ 'FOR UPDATE' ] - ); + $dbw->lockForUpdate( 'category', [ 'cat_title' => $this->mName ], __METHOD__ ); // Lock all the `categorylinks` records and gaps for this category; // this is a separate query due to postgres/oracle limitations