48 parent::__construct(
'activityUpdateJob', $params );
50 static $required = [
'type',
'userid',
'notifTime',
'curTime' ];
51 $missing = implode(
', ', array_diff( $required, array_keys( $this->params ) ) );
52 if ( $missing !=
'' ) {
53 throw new InvalidArgumentException(
"Missing parameter(s) $missing" );
56 $this->removeDuplicates =
true;
70 $casTimestamp = $this->params[
'notifTime'] ?? $this->params[
'curTime'];
79 $casTimeCond = $dbw->buildComparison(
81 [
'wl_notificationtimestamp' => $dbw->timestamp( $casTimestamp ) ]
85 $wlId = $dbw->newSelectQueryBuilder()
89 'wl_user' => $this->params[
'userid'],
90 'wl_namespace' => $this->title->getNamespace(),
91 'wl_title' => $this->title->getDBkey(),
93 ] )->caller( __METHOD__ )->fetchField();
98 $dbw->newUpdateQueryBuilder()
99 ->update(
'watchlist' )
100 ->set( [
'wl_notificationtimestamp' => $dbw->timestampOrNull( $this->params[
'notifTime'] ) ] )
101 ->where( [
'wl_id' => (
int)$wlId, $casTimeCond ] )
102 ->caller( __METHOD__ )->execute();