2020-05-15 17:19:03 +00:00
|
|
|
<?php
|
|
|
|
|
2022-04-08 00:38:27 +00:00
|
|
|
use MediaWiki\Extension\Notifications\Push\NotificationServiceClient;
|
|
|
|
use MediaWiki\Extension\Notifications\Push\SubscriptionManager;
|
2020-05-15 17:19:03 +00:00
|
|
|
use MediaWiki\MediaWikiServices;
|
|
|
|
|
|
|
|
class EchoServices {
|
|
|
|
|
|
|
|
/** @var MediaWikiServices */
|
|
|
|
private $services;
|
|
|
|
|
|
|
|
/** @return EchoServices */
|
|
|
|
public static function getInstance(): EchoServices {
|
|
|
|
return new self( MediaWikiServices::getInstance() );
|
|
|
|
}
|
|
|
|
|
2020-05-22 22:02:34 +00:00
|
|
|
/**
|
|
|
|
* @param MediaWikiServices $services
|
|
|
|
* @return EchoServices
|
|
|
|
*/
|
|
|
|
public static function wrap( MediaWikiServices $services ): EchoServices {
|
|
|
|
return new self( $services );
|
|
|
|
}
|
|
|
|
|
2020-05-15 17:19:03 +00:00
|
|
|
/** @param MediaWikiServices $services */
|
|
|
|
public function __construct( MediaWikiServices $services ) {
|
|
|
|
$this->services = $services;
|
|
|
|
}
|
|
|
|
|
2020-05-22 22:02:34 +00:00
|
|
|
/** @return NotificationServiceClient */
|
|
|
|
public function getPushNotificationServiceClient(): NotificationServiceClient {
|
|
|
|
return $this->services->getService( 'EchoPushNotificationServiceClient' );
|
|
|
|
}
|
|
|
|
|
2020-05-15 17:19:03 +00:00
|
|
|
/** @return SubscriptionManager */
|
|
|
|
public function getPushSubscriptionManager(): SubscriptionManager {
|
|
|
|
return $this->services->getService( 'EchoPushSubscriptionManager' );
|
|
|
|
}
|
|
|
|
|
2021-02-25 01:55:40 +00:00
|
|
|
/** @return EchoAttributeManager */
|
|
|
|
public function getAttributeManager(): EchoAttributeManager {
|
|
|
|
return $this->services->getService( 'EchoAttributeManager' );
|
|
|
|
}
|
|
|
|
|
2020-05-15 17:19:03 +00:00
|
|
|
}
|