mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-30 18:45:07 +00:00
c85fe25fe7
Change-Id: I8a02082466ef39db32ffa7562b02db61929346cd
25 lines
677 B
PHP
25 lines
677 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Notifications\Jobs;
|
|
|
|
use Job;
|
|
use MediaWiki\Extension\Notifications\Controller\NotificationController;
|
|
use MediaWiki\Extension\Notifications\Mapper\EventMapper;
|
|
use Title;
|
|
|
|
class NotificationJob extends Job {
|
|
|
|
public function __construct( Title $title, array $params ) {
|
|
$command = isset( $params['jobReleaseTimestamp'] ) ? 'DelayedEchoNotificationJob' : 'EchoNotificationJob';
|
|
parent::__construct( $command, $title, $params );
|
|
}
|
|
|
|
public function run() {
|
|
$eventMapper = new EventMapper();
|
|
$event = $eventMapper->fetchById( $this->params['eventId'], true );
|
|
NotificationController::notify( $event, false );
|
|
|
|
return true;
|
|
}
|
|
}
|