42 static $required = [
'type',
'userid',
'notifTime',
'curTime' ];
43 $missing = implode(
', ', array_diff( $required, array_keys( $this->params ) ) );
44 if ( $missing !=
'' ) {
45 throw new InvalidArgumentException(
"Missing parameter(s) $missing" );
48 $this->removeDuplicates =
true;
51 public function run() {
52 if ( $this->params[
'type'] ===
'updateWatchlistNotification' ) {
55 throw new InvalidArgumentException(
"Invalid 'type' '{$this->params['type']}'." );
62 $casTimestamp = $this->params[
'notifTime'] ?? $this->params[
'curTime'];
65 $dbw->update(
'watchlist',
67 'wl_notificationtimestamp' => $dbw->timestampOrNull( $this->params[
'notifTime'] )
70 'wl_user' => $this->params[
'userid'],
71 'wl_namespace' => $this->title->getNamespace(),
72 'wl_title' => $this->title->getDBkey(),
79 'wl_notificationtimestamp < ' . $dbw->addQuotes( $dbw->timestamp( $casTimestamp ) )