<?php
+
namespace example\system\user\notification\event;
+
use example\system\cache\runtime\BazRuntimeCache;
use example\system\user\notification\object\FooUserNotificationObject;
use wcf\system\email\Email;
*
* @method FooUserNotificationObject getUserNotificationObject()
*/
-class FooUserNotificationEvent extends AbstractSharedUserNotificationEvent {
+class FooUserNotificationEvent extends AbstractSharedUserNotificationEvent
+{
/**
* @inheritDoc
*/
/**
* @inheritDoc
*/
- public function checkAccess() {
+ public function checkAccess()
+ {
$this->getUserNotificationObject()->setBaz(BazRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->bazID));
if (!$this->getUserNotificationObject()->isAccessible()) {
/**
* @inheritDoc
*/
- public function getEmailMessage($notificationType = 'instant') {
+ public function getEmailMessage($notificationType = 'instant')
+ {
$this->getUserNotificationObject()->setBaz(BazRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->bazID));
- $messageID = '<com.woltlab.example.baz/'.$this->getUserNotificationObject()->bazID.'@'.Email::getHost().'>';
+ $messageID = '<com.woltlab.example.baz/' . $this->getUserNotificationObject()->bazID . '@' . Email::getHost() . '>';
return [
'application' => 'example',
'in-reply-to' => [$messageID],
- 'message-id' => 'com.woltlab.example.foo/'.$this->getUserNotificationObject()->fooID,
+ 'message-id' => 'com.woltlab.example.foo/' . $this->getUserNotificationObject()->fooID,
'references' => [$messageID],
'template' => 'email_notification_foo'
];
* @inheritDoc
* @since 5.0
*/
- public function getEmailTitle() {
+ public function getEmailTitle()
+ {
$this->getUserNotificationObject()->setBaz(BazRuntimeCache::getInstance()->getObject($this->getUserNotificationObject()->bazID));
return $this->getLanguage()->getDynamicVariable('example.foo.notification.mail.title', [
/**
* @inheritDoc
*/
- public function getEventHash() {
+ public function getEventHash()
+ {
return sha1($this->eventID . '-' . $this->getUserNotificationObject()->bazID);
}
/**
* @inheritDoc
*/
- public function getLink() {
+ public function getLink(): string
+ {
return LinkHandler::getInstance()->getLink('Foo', [
'application' => 'example',
'object' => $this->getUserNotificationObject()->getDecoratedObject()
/**
* @inheritDoc
*/
- public function getMessage() {
+ public function getMessage()
+ {
$authors = $this->getAuthors();
$count = count($authors);
/**
* @inheritDoc
*/
- public function getTitle() {
+ public function getTitle(): string
+ {
$count = count($this->getAuthors());
if ($count > 1) {
return $this->getLanguage()->getDynamicVariable('example.foo.notification.title.stacked', [
/**
* @inheritDoc
*/
- protected function prepare() {
+ protected function prepare()
+ {
BazRuntimeCache::getInstance()->cacheObjectID($this->getUserNotificationObject()->bazID);
}
-}
\ No newline at end of file
+}
<?php
+
namespace example\system\user\notification\object;
+
use example\data\foo\Foo;
use wcf\data\DatabaseObjectDecorator;
use wcf\system\user\notification\object\IUserNotificationObject;
* @method Foo getDecoratedObject()
* @mixin Foo
*/
-class FooUserNotificationObject extends DatabaseObjectDecorator implements IUserNotificationObject {
+class FooUserNotificationObject extends DatabaseObjectDecorator implements IUserNotificationObject
+{
/**
* @inheritDoc
*/
/**
* @inheritDoc
*/
- public function getTitle() {
+ public function getTitle(): string
+ {
return $this->getDecoratedObject()->getTitle();
}
/**
* @inheritDoc
*/
- public function getURL() {
+ public function getURL()
+ {
return $this->getDecoratedObject()->getLink();
}
/**
* @inheritDoc
*/
- public function getAuthorID() {
+ public function getAuthorID()
+ {
return $this->getDecoratedObject()->userID;
}
-}
\ No newline at end of file
+}