public function reserveArticles(&$aids, $langCode, WAPUser &$wu) { // Mark completed 0 and reset timestamp since assigned articles can't be completed $ts = wfTimestampNow(); $aids = array_unique($aids); $fields = array('ct_user_id' => $wu->getId(), 'ct_user_text' => $wu->getName(), 'ct_reserved_timestamp' => $ts, 'ct_completed' => 0, 'ct_completed_timestamp' => ''); $this->insertUrls($aids, $langCode, $fields, true); $dbw = wfGetDB(DB_MASTER); // marked reserved in article tag table $table = $this->wapConfig->getArticleTagTableName(); $sql = "UPDATE {$table} SET ca_reserved = 1 WHERE ca_page_id IN (" . implode(",", $aids) . ") and ca_lang_code = '{$langCode}'"; $dbw->query($sql); }