PHP Класс Fenos\Notifynder\Notifications\NotificationManager

The notification manager is responsable to manage the CRUD operations of the notifications.
Наследование: implements Fenos\Notifynder\Contracts\NotifynderNotification
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$entity string | null | null
$notifynderRepo Fenos\Notifynder\Contracts\NotificationDB

Открытые методы

Метод Описание
__construct ( Fenos\Notifynder\Contracts\NotificationDB $notifynderRepo )
countNotRead ( $toId, Closur\Closure $filterScope = null ) : mixed Get number of notification not read.
delete ( $notificationId ) : boolean Delete a notification giving the id of it.
deleteAll ( $entityId ) : boolean Delete all notification of a given Entity.
deleteByCategory ( $categoryName, $expired = false ) : boolean Delete All notifications from a defined category.
deleteLimit ( $entityId, $number, $order = 'asc' ) : mixed Delete numbers of notifications equals to the number passing as 2 parameter of the current user.
entity ( $name ) Set the entity for polymorphic.
find ( $notificationId ) : Notification | Model | static Find a notification by ID.
getAll ( $toId, $limit = null, integer | null $paginate = null, string $orderDate = 'desc', Closur\Closure $filterScope = null ) : mixed Get All notifications.
getLastNotification ( $toId, Closur\Closure $filterScope = null ) : mixed Get last notification of the given entity.
getLastNotificationByCategory ( $category, $toId, Closur\Closure $filterScope = null ) : mixed Get last notification of the given entity of the specific category.
getNotRead ( $toId, $limit = null, integer | null $paginate = null, string $orderDate = 'desc', Closur\Closure $filterScope = null ) : mixed Get notifications not read of the entity given.
readAll ( $toId ) : Number Read all notification of the given entity.
readLimit ( $toId, $numbers, string $order = 'ASC' ) : mixed Read notifications in base the number Given.
readOne ( $notificationId ) : boolean | Notification Make read one notification giving the ID of it.
sendMultiple ( array $info ) : mixed Send multiple notifications.
sendOne ( array $info ) : static Send single notification.

Защищенные методы

Метод Описание
getPaginatedIfNeeded ( NotifynderCollection $notifications, $perPage, $paginate )
isPaginated ( $paginate )

Описание методов

__construct() публичный Метод

public __construct ( Fenos\Notifynder\Contracts\NotificationDB $notifynderRepo )
$notifynderRepo Fenos\Notifynder\Contracts\NotificationDB

countNotRead() публичный Метод

Get number of notification not read.
public countNotRead ( $toId, Closur\Closure $filterScope = null ) : mixed
$toId
$filterScope Closur\Closure
Результат mixed

delete() публичный Метод

Delete a notification giving the id of it.
public delete ( $notificationId ) : boolean
$notificationId
Результат boolean

deleteAll() публичный Метод

Delete all notification of a given Entity.
public deleteAll ( $entityId ) : boolean
$entityId
Результат boolean

deleteByCategory() публичный Метод

Delete All notifications from a defined category.
public deleteByCategory ( $categoryName, $expired = false ) : boolean
$categoryName string
$expired Bool
Результат boolean

deleteLimit() публичный Метод

Delete numbers of notifications equals to the number passing as 2 parameter of the current user.
public deleteLimit ( $entityId, $number, $order = 'asc' ) : mixed
$entityId
$number
$order
Результат mixed

entity() публичный Метод

Set the entity for polymorphic.
public entity ( $name )
$name

find() публичный Метод

Find a notification by ID.
public find ( $notificationId ) : Notification | Model | static
$notificationId
Результат Fenos\Notifynder\Models\Notification | Illuminate\Database\Eloquent\Model | static

getAll() публичный Метод

Get All notifications.
public getAll ( $toId, $limit = null, integer | null $paginate = null, string $orderDate = 'desc', Closur\Closure $filterScope = null ) : mixed
$toId
$limit
$paginate integer | null
$orderDate string
$filterScope Closur\Closure
Результат mixed

getLastNotification() публичный Метод

Get last notification of the given entity.
public getLastNotification ( $toId, Closur\Closure $filterScope = null ) : mixed
$toId
$filterScope Closur\Closure
Результат mixed

getLastNotificationByCategory() публичный Метод

Get last notification of the given entity of the specific category.
public getLastNotificationByCategory ( $category, $toId, Closur\Closure $filterScope = null ) : mixed
$category
$toId
$filterScope Closur\Closure
Результат mixed

getNotRead() публичный Метод

Get notifications not read of the entity given.
public getNotRead ( $toId, $limit = null, integer | null $paginate = null, string $orderDate = 'desc', Closur\Closure $filterScope = null ) : mixed
$toId
$limit
$paginate integer | null
$orderDate string
$filterScope Closur\Closure
Результат mixed

getPaginatedIfNeeded() защищенный Метод

protected getPaginatedIfNeeded ( NotifynderCollection $notifications, $perPage, $paginate )
$notifications Fenos\Notifynder\Models\NotifynderCollection

isPaginated() защищенный Метод

protected isPaginated ( $paginate )

readAll() публичный Метод

Read all notification of the given entity.
public readAll ( $toId ) : Number
$toId
Результат Number

readLimit() публичный Метод

Read notifications in base the number Given.
public readLimit ( $toId, $numbers, string $order = 'ASC' ) : mixed
$toId
$numbers
$order string
Результат mixed

readOne() публичный Метод

Make read one notification giving the ID of it.
public readOne ( $notificationId ) : boolean | Notification
$notificationId
Результат boolean | Fenos\Notifynder\Models\Notification

sendMultiple() публичный Метод

Send multiple notifications.
public sendMultiple ( array $info ) : mixed
$info array
Результат mixed

sendOne() публичный Метод

Send single notification.
public sendOne ( array $info ) : static
$info array
Результат static

Описание свойств

$entity защищенное свойство

| null
protected string|null $entity
Результат string | null

$notifynderRepo защищенное свойство

protected NotificationDB,Fenos\Notifynder\Contracts $notifynderRepo
Результат Fenos\Notifynder\Contracts\NotificationDB