PHP Class Owl\Handlers\Events\EmailNotification

Show file Open project: owl/owl

Protected Properties

Property Type Description
$itemService Owl\Services\ItemService
$mail Illuminate\Contracts\Mail\Mailer
$mailNotifyService Owl\Services\MailNotifyService
$userRoleService Owl\Services\UserRoleService
$userService Owl\Services\UserService

Public Methods

Method Description
__construct ( Illuminate\Contracts\Mail\Mailer $mailer, ItemService $itemService, UserService $userService, UserRoleService $userRoleService, MailNotifyService $mailNotifyService )
onGetComment ( CommentEvent $event ) 記事にコメントがついた時のメール通知
onGetFavorite ( Owl\Events\Item\FavoriteEvent $event ) 記事がお気に入りされた時
onGetLike ( Owl\Events\Item\LikeEvent $event ) 記事にいいね!がついた時
onItemEdited ( Owl\Events\Item\EditEvent $event ) 記事が編集された時
subscribe ( Illuminate\Events\Dispatcher $events ) 各イベントにハンドラーメソッドを登録

Protected Methods

Method Description
areUsersSame ( stdclass $recipient, stdclass $sender ) : boolean 通知を発生させたユーザと通知を受け取るユーザが同じかチェックする
getDataForMail ( stdclass $item, stdclass $recipient, stdclass $sender ) : array Mail View用の基本データを取得
notificationIsEnabled ( string $type, integer $userId ) : boolean 通知設定をONにしてるかどうかチェックする

Method Details

__construct() public method

public __construct ( Illuminate\Contracts\Mail\Mailer $mailer, ItemService $itemService, UserService $userService, UserRoleService $userRoleService, MailNotifyService $mailNotifyService )
$mailer Illuminate\Contracts\Mail\Mailer
$itemService Owl\Services\ItemService
$userService Owl\Services\UserService
$userRoleService Owl\Services\UserRoleService
$mailNotifyService Owl\Services\MailNotifyService

areUsersSame() protected method

通知を発生させたユーザと通知を受け取るユーザが同じかチェックする
protected areUsersSame ( stdclass $recipient, stdclass $sender ) : boolean
$recipient stdclass
$sender stdclass
return boolean

getDataForMail() protected method

Mail View用の基本データを取得
protected getDataForMail ( stdclass $item, stdclass $recipient, stdclass $sender ) : array
$item stdclass
$recipient stdclass
$sender stdclass
return array

notificationIsEnabled() protected method

通知設定をONにしてるかどうかチェックする
protected notificationIsEnabled ( string $type, integer $userId ) : boolean
$type string
$userId integer
return boolean

onGetComment() public method

記事にコメントがついた時のメール通知
public onGetComment ( CommentEvent $event )
$event Owl\Events\Item\CommentEvent

onGetFavorite() public method

記事がお気に入りされた時
public onGetFavorite ( Owl\Events\Item\FavoriteEvent $event )
$event Owl\Events\Item\FavoriteEvent

onGetLike() public method

記事にいいね!がついた時
public onGetLike ( Owl\Events\Item\LikeEvent $event )
$event Owl\Events\Item\LikeEvent

onItemEdited() public method

記事が編集された時
public onItemEdited ( Owl\Events\Item\EditEvent $event )
$event Owl\Events\Item\EditEvent

subscribe() public method

各イベントにハンドラーメソッドを登録
public subscribe ( Illuminate\Events\Dispatcher $events )
$events Illuminate\Events\Dispatcher

Property Details

$itemService protected property

protected ItemService,Owl\Services $itemService
return Owl\Services\ItemService

$mail protected property

protected Mailer,Illuminate\Contracts\Mail $mail
return Illuminate\Contracts\Mail\Mailer

$mailNotifyService protected property

protected MailNotifyService,Owl\Services $mailNotifyService
return Owl\Services\MailNotifyService

$userRoleService protected property

protected UserRoleService,Owl\Services $userRoleService
return Owl\Services\UserRoleService

$userService protected property

protected UserService,Owl\Services $userService
return Owl\Services\UserService