$notify = DI::notify()->getByID($id);
DI::notify()->setSeen(true, $notify);
- if ($notify->otype === Notify::OTYPE_ITEM) {
+ if ($notify->otype === Notify\ObjectType::ITEM) {
$item = Item::selectFirstForUser(api_user(), [], ['id' => $notify->iid, 'uid' => api_user()]);
if (DBA::isResult($item)) {
// we found the item, return it to the user
// if it's a post figure out who's post it is.
$item = null;
- if ($params['otype'] === Notify::OTYPE_ITEM && $parent_id) {
+ if ($params['otype'] === Notify\ObjectType::ITEM && $parent_id) {
$item = Item::selectFirstForUser($params['uid'], Item::ITEM_FIELDLIST, ['id' => $parent_id, 'deleted' => false]);
}
*/
class Notify extends BaseModel
{
- const OTYPE_ITEM = 'item';
- const OTYPE_INTRO = 'intro';
- const OTYPE_MAIL = 'mail';
- const OTYPE_PERSON = 'person';
/** @var \Friendica\Repository\Notify */
private $repo;
--- /dev/null
+<?php
+
+namespace Friendica\Model\Notify;
+
+/**
+ * Enum for different otypes of the Notify
+ */
+class ObjectType
+{
+ const PERSON = 'person';
+ const MAIL = 'mail';
+ const ITEM = 'item';
+ const INTRO = 'intro';
+}