PHP Class Fenos\Notifynder\Notifications\NotificationManager

The notification manager is responsable to manage the CRUD operations of the notifications.
Inheritance: implements Fenos\Notifynder\Contracts\NotifynderNotification
ファイルを表示 Open project: fenos/notifynder Class Usage Examples

Protected Properties

Property Type Description
$entity string | null | null
$notifynderRepo Fenos\Notifynder\Contracts\NotificationDB

Public Methods

Method Description
__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.

Protected Methods

Method Description
getPaginatedIfNeeded ( NotifynderCollection $notifications, $perPage, $paginate )
isPaginated ( $paginate )

Method Details

__construct() public method

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

countNotRead() public method

Get number of notification not read.
public countNotRead ( $toId, Closur\Closure $filterScope = null ) : mixed
$toId
$filterScope Closur\Closure
return mixed

delete() public method

Delete a notification giving the id of it.
public delete ( $notificationId ) : boolean
$notificationId
return boolean

deleteAll() public method

Delete all notification of a given Entity.
public deleteAll ( $entityId ) : boolean
$entityId
return boolean

deleteByCategory() public method

Delete All notifications from a defined category.
public deleteByCategory ( $categoryName, $expired = false ) : boolean
$categoryName string
$expired Bool
return boolean

deleteLimit() public method

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
return mixed

entity() public method

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

find() public method

Find a notification by ID.
public find ( $notificationId ) : Notification | Model | static
$notificationId
return Fenos\Notifynder\Models\Notification | Illuminate\Database\Eloquent\Model | static

getAll() public method

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
return mixed

getLastNotification() public method

Get last notification of the given entity.
public getLastNotification ( $toId, Closur\Closure $filterScope = null ) : mixed
$toId
$filterScope Closur\Closure
return mixed

getLastNotificationByCategory() public method

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
return mixed

getNotRead() public method

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
return mixed

getPaginatedIfNeeded() protected method

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

isPaginated() protected method

protected isPaginated ( $paginate )

readAll() public method

Read all notification of the given entity.
public readAll ( $toId ) : Number
$toId
return Number

readLimit() public method

Read notifications in base the number Given.
public readLimit ( $toId, $numbers, string $order = 'ASC' ) : mixed
$toId
$numbers
$order string
return mixed

readOne() public method

Make read one notification giving the ID of it.
public readOne ( $notificationId ) : boolean | Notification
$notificationId
return boolean | Fenos\Notifynder\Models\Notification

sendMultiple() public method

Send multiple notifications.
public sendMultiple ( array $info ) : mixed
$info array
return mixed

sendOne() public method

Send single notification.
public sendOne ( array $info ) : static
$info array
return static

Property Details

$entity protected_oe property

| null
protected string|null $entity
return string | null

$notifynderRepo protected_oe property

protected NotificationDB,Fenos\Notifynder\Contracts $notifynderRepo
return Fenos\Notifynder\Contracts\NotificationDB