PHP Class Fenos\Notifynder\NotifynderManager

Notifynder is a Facade Class that has all the methods necesessary to use the library. Notifynder allow you to have a flexible notification management. It will provide you a nice and easy API to store, retrieve and organise your notifications.
Inheritance: extends Fenos\Notifynder\Builder\NotifynderBuilder, implements Fenos\Notifynder\Notifynder
Exibir arquivo Open project: fenos/notifynder Class Usage Examples

Protected Properties

Property Type Description
$categoriesContainer array
$defaultCategory Fenos\Notifynder\Models\NotificationCategory | null
$entity string | null | null
$eventSender string This sender method will be used on the dispatcher.
$notification Fenos\Notifynder\Contracts\NotifynderNotification
$notifynderCategory Fenos\Notifynder\Contracts\NotifynderCategory
$notifynderDispatcher Fenos\Notifynder\Contracts\NotifynderDispatcher
$notifynderGroup Fenos\Notifynder\Contracts\NotifynderGroup
$notifynderSender Fenos\Notifynder\Contracts\NotifynderSender

Public Methods

Method Description
__call ( $name, $arguments ) : void | mixed Call the custom sender method.
__construct ( Fenos\Notifynder\Contracts\NotifynderCategory $notifynderCategory, Fenos\Notifynder\Contracts\NotifynderSender $notifynderSender, Fenos\Notifynder\Contracts\NotifynderNotification $notification, Fenos\Notifynder\Contracts\NotifynderDispatcher $notifynderDispatcher, Fenos\Notifynder\Contracts\NotifynderGroup $notifynderGroup )
__get ( $name ) : mixed Get property from the builder.
__set ( $name, $value ) Set builder properties When setting dynamic properties.
addCategoriesToGroup ( ) : mixed Add categories to a group having as first parameter the name of the group, and others as name categories.
addCategory ( $name, $text ) : static Add a category.
addCategoryToGroupById ( $groupId, $categoryId ) : mixed Add category to a group giving the ids of them.
addCategoryToGroupByName ( $groupName, $categoryName ) : mixed Add category to a group giving the names of them.
bootListeners ( array $listeners ) Boot Listeners.
builder ( ) : NotifynderBuilder Get instance of the notifynder builder.
category ( $name ) Set the category of the notification.
countNotRead ( $toId, Closur\Closure $filterScope = null ) : mixed Get number of notification not read of the given entity.
delegate ( array $delegation, $data = [] ) : mixed Associate events to categories.
delete ( $notificationId ) : boolean Delete a single notification.
deleteAll ( $toId ) : boolean Delete all notifications of the the given entity.
deleteByCategory ( $categoryName, $expired = false ) : boolean Delete All notifications from a defined category.
deleteLimit ( $toId, $number, string $order = 'ASC' ) : mixed Delete number of notifications specified of the given entity.
dispatchWith ( $customSenderName ) Define which method the event dispatcher has to send the notifications.
entity ( $name ) Define an entity when Notifynder is used Polymorphically.
extend ( $name, callable $registrar ) Extend a custom sender method.
findNotificationById ( $notificationId ) : Illuminate\Database\Eloquent\Collection | Model | static Find Notification by ID.
fire ( string $key, string $categoryName, mixed | null $values = [] ) : mixed | null Fire method for fire listeners of logic.
getAll ( $toId, null $limit = null, integer | null $paginate = null, string $order = 'desc', Closur\Closure $filterScope = null ) : mixed Get all notifications of the given entity.
getCategoriesContainer ( $name ) : array Get the categoriesContainer property.
getLastNotification ( $toId, null $category = null, Closur\Closure $filterScope = null ) : mixed Get last notification of the given entity, second parameter can filter by category.
getNotRead ( $toId, null $limit = null, null | integer $paginate = null, string $order = 'desc', Closur\Closure $filterScope = null ) : mixed Get Notifications not read of the given entity.
id ( ) : mixed Return the Id of the category.
readAll ( $toId ) : Number Read all notifications of the given entity.
readLimit ( $toId, $numbers, string $order = 'ASC' ) : mixed Read notification in base the number Given.
readOne ( $notificationId ) : boolean | Notification Read one notification.
send ( array $info = [] ) : mixed Send notifications Both multiple and single.
sendGroup ( $groupName, $info = [] ) : mixed Send a group of notifications.
sendMultiple ( array $info = [] ) : SendMultiple Send multiple notifications.
sendNow ( array $info = [] ) : mixed Send immediately the notification even if the queue is enabled.
sendOne ( array $info = [] ) : mixed Send One notification.
updateCategory ( array $updates, $categoryId ) : mixed Update a category.

Protected Methods

Method Description
isLazyLoaded ( $name ) : boolean Check if the category is eager Loaded.
setCategoriesContainer ( $name, array $categoriesContainer ) Push a category in the categoriesContainer property.

Method Details

__call() public method

Call the custom sender method.
public __call ( $name, $arguments ) : void | mixed
$name
$arguments
return void | mixed

__construct() public method

public __construct ( Fenos\Notifynder\Contracts\NotifynderCategory $notifynderCategory, Fenos\Notifynder\Contracts\NotifynderSender $notifynderSender, Fenos\Notifynder\Contracts\NotifynderNotification $notification, Fenos\Notifynder\Contracts\NotifynderDispatcher $notifynderDispatcher, Fenos\Notifynder\Contracts\NotifynderGroup $notifynderGroup )
$notifynderCategory Fenos\Notifynder\Contracts\NotifynderCategory
$notifynderSender Fenos\Notifynder\Contracts\NotifynderSender
$notification Fenos\Notifynder\Contracts\NotifynderNotification
$notifynderDispatcher Fenos\Notifynder\Contracts\NotifynderDispatcher
$notifynderGroup Fenos\Notifynder\Contracts\NotifynderGroup

__get() public method

Get property from the builder.
public __get ( $name ) : mixed
$name
return mixed

__set() public method

Set builder properties When setting dynamic properties.
public __set ( $name, $value )
$name
$value

addCategoriesToGroup() public method

Add categories to a group having as first parameter the name of the group, and others as name categories.
public addCategoriesToGroup ( ) : mixed
return mixed

addCategory() public method

Add a category.
public addCategory ( $name, $text ) : static
$name
$text
return static

addCategoryToGroupById() public method

Add category to a group giving the ids of them.
public addCategoryToGroupById ( $groupId, $categoryId ) : mixed
$groupId
$categoryId
return mixed

addCategoryToGroupByName() public method

Add category to a group giving the names of them.
public addCategoryToGroupByName ( $groupName, $categoryName ) : mixed
$groupName
$categoryName
return mixed

bootListeners() public method

Boot Listeners.
public bootListeners ( array $listeners )
$listeners array

builder() public method

Get instance of the notifynder builder.
public builder ( ) : NotifynderBuilder
return Fenos\Notifynder\Builder\NotifynderBuilder

category() public method

Set the category of the notification.
public category ( $name )
$name

countNotRead() public method

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

delegate() public method

Associate events to categories.
public delegate ( array $delegation, $data = [] ) : mixed
$delegation array
$data
return mixed

delete() public method

Delete a single notification.
public delete ( $notificationId ) : boolean
$notificationId
return boolean

deleteAll() public method

Delete all notifications of the the given entity.
public deleteAll ( $toId ) : boolean
$toId
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 number of notifications specified of the given entity.
public deleteLimit ( $toId, $number, string $order = 'ASC' ) : mixed
$toId
$number
$order string
return mixed

dispatchWith() public method

Define which method the event dispatcher has to send the notifications.
public dispatchWith ( $customSenderName )
$customSenderName

entity() public method

Define an entity when Notifynder is used Polymorphically.
public entity ( $name )
$name

extend() public method

Extend a custom sender method.
public extend ( $name, callable $registrar )
$name
$registrar callable

findNotificationById() public method

Find Notification by ID.
public findNotificationById ( $notificationId ) : Illuminate\Database\Eloquent\Collection | Model | static
$notificationId
return Illuminate\Database\Eloquent\Collection | Illuminate\Database\Eloquent\Model | static

fire() public method

Fire method for fire listeners of logic.
public fire ( string $key, string $categoryName, mixed | null $values = [] ) : mixed | null
$key string
$categoryName string
$values mixed | null
return mixed | null

getAll() public method

Get all notifications of the given entity.
public getAll ( $toId, null $limit = null, integer | null $paginate = null, string $order = 'desc', Closur\Closure $filterScope = null ) : mixed
$toId
$limit null
$paginate integer | null
$order string
$filterScope Closur\Closure
return mixed

getCategoriesContainer() public method

Get the categoriesContainer property.
public getCategoriesContainer ( $name ) : array
$name
return array

getLastNotification() public method

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

getNotRead() public method

Get Notifications not read of the given entity.
public getNotRead ( $toId, null $limit = null, null | integer $paginate = null, string $order = 'desc', Closur\Closure $filterScope = null ) : mixed
$toId
$limit null
$paginate null | integer
$order string
$filterScope Closur\Closure
return mixed

id() public method

Return the Id of the category.
public id ( ) : mixed
return mixed

isLazyLoaded() protected method

Check if the category is eager Loaded.
protected isLazyLoaded ( $name ) : boolean
$name
return boolean

readAll() public method

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

readLimit() public method

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

readOne() public method

Read one notification.
public readOne ( $notificationId ) : boolean | Notification
$notificationId
return boolean | Fenos\Notifynder\Models\Notification

send() public method

Send notifications Both multiple and single.
public send ( array $info = [] ) : mixed
$info array
return mixed

sendGroup() public method

Send a group of notifications.
public sendGroup ( $groupName, $info = [] ) : mixed
$groupName
$info
return mixed

sendMultiple() public method

Send multiple notifications.
public sendMultiple ( array $info = [] ) : SendMultiple
$info array
return Fenos\Notifynder\Senders\SendMultiple

sendNow() public method

Send immediately the notification even if the queue is enabled.
public sendNow ( array $info = [] ) : mixed
$info array
return mixed

sendOne() public method

Send One notification.
public sendOne ( array $info = [] ) : mixed
$info array
return mixed

setCategoriesContainer() protected method

Push a category in the categoriesContainer property.
protected setCategoriesContainer ( $name, array $categoriesContainer )
$name
$categoriesContainer array

updateCategory() public method

Update a category.
public updateCategory ( array $updates, $categoryId ) : mixed
$updates array
$categoryId
return mixed

Property Details

$categoriesContainer protected_oe property

protected array $categoriesContainer
return array

$defaultCategory protected_oe property

protected NotificationCategory,Fenos\Notifynder\Models|null $defaultCategory
return Fenos\Notifynder\Models\NotificationCategory | null

$entity protected_oe property

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

$eventSender protected_oe property

This sender method will be used on the dispatcher.
protected string $eventSender
return string

$notification protected_oe property

protected NotifynderNotification,Fenos\Notifynder\Contracts $notification
return Fenos\Notifynder\Contracts\NotifynderNotification

$notifynderCategory protected_oe property

protected NotifynderCategory,Fenos\Notifynder\Contracts $notifynderCategory
return Fenos\Notifynder\Contracts\NotifynderCategory

$notifynderDispatcher protected_oe property

protected NotifynderDispatcher,Fenos\Notifynder\Contracts $notifynderDispatcher
return Fenos\Notifynder\Contracts\NotifynderDispatcher

$notifynderGroup protected_oe property

protected NotifynderGroup,Fenos\Notifynder\Contracts $notifynderGroup
return Fenos\Notifynder\Contracts\NotifynderGroup

$notifynderSender protected_oe property

protected NotifynderSender,Fenos\Notifynder\Contracts $notifynderSender
return Fenos\Notifynder\Contracts\NotifynderSender