PHP Class Fenos\Notifynder\Handler\NotifynderHandler

Mostrar archivo Open project: fenos/notifynder

Public Methods

Method Description
handle ( Fenos\Notifynder\Contracts\NotifyListener $eventListener, null $notifynder = null ) : mixed Handle the event.

Protected Methods

Method Description
getEventName ( $event ) : string Get Event Name from the key it use a convention.
getNotifynder ( ) : Fenos\Notifynder\Notifynder Get Notifynder Instance.
hasNotificationToSend ( $notificationsResult ) : boolean Check if the fired method has some notifications to send.
listenerIsRegistered ( $eventName ) : boolean Check if the listener exists on the class adding when as convention.

Method Details

getEventName() protected method

given user.post.add -> postAdd given user@postAdd -> postAdd
protected getEventName ( $event ) : string
$event
return string

getNotifynder() protected method

Get Notifynder Instance.
protected getNotifynder ( ) : Fenos\Notifynder\Notifynder
return Fenos\Notifynder\Notifynder

handle() public method

Handle the event.
public handle ( Fenos\Notifynder\Contracts\NotifyListener $eventListener, null $notifynder = null ) : mixed
$eventListener Fenos\Notifynder\Contracts\NotifyListener
$notifynder null
return mixed

hasNotificationToSend() protected method

Check if the fired method has some notifications to send.
protected hasNotificationToSend ( $notificationsResult ) : boolean
$notificationsResult
return boolean

listenerIsRegistered() protected method

['postAdd'] whenPostAdd]
protected listenerIsRegistered ( $eventName ) : boolean
$eventName
return boolean