bakaphp /
phalcon-api
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Gewaer\Handlers; |
||
| 4 | |||
| 5 | use Namshi\Notificator\Notification\Handler\HandlerInterface; |
||
| 6 | use Gewaer\Contracts\PushNotifications as PushNotificationsContract; |
||
| 7 | use Phalcon\Http\Response; |
||
| 8 | use Namshi\Notificator\NotificationInterface; |
||
| 9 | use Phalcon\Di; |
||
| 10 | use Gewaer\Notifications\Mobile\Apps; |
||
| 11 | use Gewaer\Notifications\Mobile\Mobile; |
||
| 12 | use Gewaer\Models\Notifications; |
||
| 13 | use Gewaer\Models\SystemModules; |
||
| 14 | |||
| 15 | class PushNotificationsHandler implements HandlerInterface |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * Stablishes type of handler |
||
| 19 | */ |
||
| 20 | public function shouldHandle(NotificationInterface $notification) |
||
| 21 | { |
||
| 22 | return $notification instanceof PushNotificationsContract; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Handles actions to take depending of notifications |
||
| 27 | * @param NotificationInterface $notification |
||
| 28 | */ |
||
| 29 | public function handle(NotificationInterface $notification) |
||
| 30 | { |
||
| 31 | |||
| 32 | //Push the notification.In this case we are just logging the info |
||
| 33 | Di::getDefault()->getLog()->info($notification->assemble()); |
||
|
1 ignored issue
–
show
Bug
introduced
by
Loading history...
|
|||
| 34 | } |
||
| 35 | } |
||
| 36 |