diff --git a/Admin/Installer.php b/Admin/Installer.php index 20b04a5..d46e5ca 100755 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -14,10 +14,7 @@ declare(strict_types=1); namespace Modules\Notification\Admin; -use phpOMS\Application\ApplicationAbstract; -use phpOMS\Config\SettingsInterface; use phpOMS\Module\InstallerAbstract; -use phpOMS\Module\ModuleInfo; /** * Installer class. @@ -36,12 +33,4 @@ final class Installer extends InstallerAbstract * @since 1.0.0 */ public const PATH = __DIR__; - - /** - * {@inheritdoc} - */ - public static function install(ApplicationAbstract $app, ModuleInfo $info, SettingsInterface $cfgHandler) : void - { - parent::install($app, $info, $cfgHandler); - } } diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 607b8a8..859542b 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -47,6 +47,8 @@ final class ApiController extends Controller public function apiNotificationSeenCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void { $now = new \DateTimeImmutable('now'); + + /** @var \Modules\Notification\Models\Notification[] $notifications */ $notifications = NotificationMapper::getAll() ->where('createdFor', $request->header->account) ->where('seenAt', null) @@ -55,7 +57,7 @@ final class ApiController extends Controller ->execute(); foreach ($notifications as $notification) { - $new = clone $notification; + $new = clone $notification; $new->seenAt = $now; $this->updateModel($request->header->account, $notification, $new, NotificationMapper::class, 'notification', $request->getOrigin()); @@ -79,7 +81,7 @@ final class ApiController extends Controller */ public function apiNotificationsGet(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void { - $now = new \DateTimeImmutable('now'); + $now = new \DateTimeImmutable('now'); $notifications = NotificationMapper::getAll() ->where('createdFor', $request->header->account) ->where('seenAt', null) diff --git a/Models/Notification.php b/Models/Notification.php index 69a3d74..57fb249 100755 --- a/Models/Notification.php +++ b/Models/Notification.php @@ -131,9 +131,9 @@ class Notification implements \JsonSerializable */ public function __construct() { - $this->createdBy = new NullAccount(); + $this->createdBy = new NullAccount(); $this->createdFor = new NullAccount(); - $this->createdAt = new \DateTimeImmutable('now'); + $this->createdAt = new \DateTimeImmutable('now'); } /** diff --git a/Models/NotificationMapper.php b/Models/NotificationMapper.php index d7582b3..208e009 100755 --- a/Models/NotificationMapper.php +++ b/Models/NotificationMapper.php @@ -43,14 +43,14 @@ final class NotificationMapper extends DataMapperFactory 'notification_desc_raw' => ['name' => 'notification_desc_raw', 'type' => 'string', 'internal' => 'descriptionRaw'], 'notification_type' => ['name' => 'notification_type', 'type' => 'int', 'internal' => 'type'], 'notification_status' => ['name' => 'notification_status', 'type' => 'int', 'internal' => 'status'], - 'notification_module' => ['name' => 'notification_module', 'type' => 'string', 'internal' => 'module'], - 'notification_category' => ['name' => 'notification_category', 'type' => 'int', 'internal' => 'category'], - 'notification_element' => ['name' => 'notification_element', 'type' => 'int', 'internal' => 'element'], + 'notification_module' => ['name' => 'notification_module', 'type' => 'string', 'internal' => 'module'], + 'notification_category' => ['name' => 'notification_category', 'type' => 'int', 'internal' => 'category'], + 'notification_element' => ['name' => 'notification_element', 'type' => 'int', 'internal' => 'element'], 'notification_redirect' => ['name' => 'notification_redirect', 'type' => 'string', 'internal' => 'redirect'], 'notification_created_by' => ['name' => 'notification_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], 'notification_for' => ['name' => 'notification_for', 'type' => 'int', 'internal' => 'createdFor'], 'notification_created_at' => ['name' => 'notification_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], - 'notification_seen_at' => ['name' => 'notification_seen_at', 'type' => 'DateTimeImmutable', 'internal' => 'seenAt'], + 'notification_seen_at' => ['name' => 'notification_seen_at', 'type' => 'DateTimeImmutable', 'internal' => 'seenAt'], ]; /** diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index a74ea0b..d683752 100755 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -13,5 +13,5 @@ declare(strict_types=1); return ['Navigation' => [ - 'Notifications' => 'Notifications', + 'Notifications' => 'Notifications', ]]; diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index 725fb62..bb252a0 100644 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -13,13 +13,13 @@ declare(strict_types=1); return ['Notification' => [ - 'Notifications' => 'Nachrichten', - 'Title' => 'Titel', - 'Date' => 'Datum', + 'Notifications' => 'Nachrichten', + 'Title' => 'Titel', + 'Date' => 'Datum', ':status-text-1' => 'Neues %s Element erstellt', ':status-text-2' => '%s Element upgedated', ':status-text-3' => 'Neues Element zu %s hinzugefügt', - ':status-1' => 'Neu', - ':status-2' => 'Update', - ':status-3' => 'Update', -]]; \ No newline at end of file + ':status-1' => 'Neu', + ':status-2' => 'Update', + ':status-3' => 'Update', +]]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 53553d4..a27db76 100644 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -13,14 +13,14 @@ declare(strict_types=1); return ['Notification' => [ - 'Notifications' => 'Notifications', - 'Title' => 'Title', - 'Date' => 'Date', - 'MarkSeen' => 'Mark Seen', + 'Notifications' => 'Notifications', + 'Title' => 'Title', + 'Date' => 'Date', + 'MarkSeen' => 'Mark Seen', ':status-text-1' => 'New %s element created', ':status-text-2' => '%s element updated', ':status-text-3' => 'New element added to %s', - ':status-1' => 'New', - ':status-2' => 'Update', - ':status-3' => 'Update', -]]; \ No newline at end of file + ':status-1' => 'New', + ':status-2' => 'Update', + ':status-3' => 'Update', +]];