2012-06-06 07:04:28 +00:00
|
|
|
<?php
|
|
|
|
|
2022-11-02 04:15:17 +00:00
|
|
|
namespace MediaWiki\Extension\Notifications\Jobs;
|
|
|
|
|
|
|
|
use Job;
|
2022-11-02 03:51:15 +00:00
|
|
|
use MediaWiki\Extension\Notifications\Controller\NotificationController;
|
2022-11-02 20:47:04 +00:00
|
|
|
use MediaWiki\Extension\Notifications\Mapper\EventMapper;
|
2022-11-02 04:15:17 +00:00
|
|
|
use Title;
|
2022-11-02 03:51:15 +00:00
|
|
|
|
2022-11-02 04:15:17 +00:00
|
|
|
class NotificationJob extends Job {
|
2018-06-18 16:54:03 +00:00
|
|
|
|
2019-10-23 10:44:35 +00:00
|
|
|
public function __construct( Title $title, array $params ) {
|
2020-10-09 14:09:21 +00:00
|
|
|
$command = isset( $params['jobReleaseTimestamp'] ) ? 'DelayedEchoNotificationJob' : 'EchoNotificationJob';
|
|
|
|
parent::__construct( $command, $title, $params );
|
2012-06-06 07:04:28 +00:00
|
|
|
}
|
|
|
|
|
2018-11-02 17:47:39 +00:00
|
|
|
public function run() {
|
2022-11-02 20:47:04 +00:00
|
|
|
$eventMapper = new EventMapper();
|
2019-04-12 17:02:50 +00:00
|
|
|
$event = $eventMapper->fetchById( $this->params['eventId'], true );
|
2022-11-02 03:51:15 +00:00
|
|
|
NotificationController::notify( $event, false );
|
2015-10-01 13:48:52 +00:00
|
|
|
|
2014-08-02 06:41:19 +00:00
|
|
|
return true;
|
|
|
|
}
|
2012-07-18 19:39:33 +00:00
|
|
|
}
|