38 static $required = [
'type',
'userid',
'notifTime',
'curTime' ];
39 $missing = implode(
', ', array_diff( $required, array_keys( $this->params ) ) );
40 if ( $missing !=
'' ) {
41 throw new InvalidArgumentException(
"Missing paramter(s) $missing" );
44 $this->removeDuplicates =
true;
47 public function run() {
48 if ( $this->params[
'type'] ===
'updateWatchlistNotification' ) {
51 throw new InvalidArgumentException(
"Invalid 'type' '{$this->params['type']}'." );
58 $casTimestamp = ( $this->params[
'notifTime'] !== null )
59 ? $this->params[
'notifTime']
60 : $this->params[
'curTime'];
63 $dbw->update(
'watchlist',
65 'wl_notificationtimestamp' => $dbw->timestampOrNull( $this->params[
'notifTime'] )
68 'wl_user' => $this->params[
'userid'],
69 'wl_namespace' => $this->
title->getNamespace(),
70 'wl_title' => $this->
title->getDBkey(),
77 'wl_notificationtimestamp < ' . $dbw->addQuotes( $dbw->timestamp( $casTimestamp ) )