mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-18 10:52:27 +00:00
84e0d10abd
Bug: T321681 Change-Id: I19ff201e3a109d5f6b755c6c0857f7b22d08d26d
25 lines
693 B
PHP
25 lines
693 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Notifications\Jobs;
|
|
|
|
use Job;
|
|
use MediaWiki\Extension\Notifications\Controller\NotificationController;
|
|
use MediaWiki\Extension\Notifications\Mapper\EventMapper;
|
|
use MediaWiki\Title\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;
|
|
}
|
|
}
|