PHP 클래스 Flarum\Core\Notification\NotificationSyncer

파일 보기 프로젝트 열기: flarum/core 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$mailer NotificationMailer
$notifications Flarum\Core\Repository\NotificationRepository
$onePerUser boolean Whether or not notifications are being limited to one per user.
$sentTo int[] An internal list of user IDs that notifications have been sent to.

공개 메소드들

메소드 설명
__construct ( NotificationRepository $notifications, NotificationMailer $mailer )
delete ( Flarum\Core\Notification\BlueprintInterface $blueprint ) : void Delete a notification for all users.
onePerUser ( callable $callback ) : void Limit notifications to one per user for the entire duration of the given callback.
restore ( Flarum\Core\Notification\BlueprintInterface $blueprint ) : void Restore a notification for all users.
sync ( Flarum\Core\Notification\BlueprintInterface $blueprint, array $users ) : void Sync a notification so that it is visible to the specified users, and not visible to anyone else. If it is being made visible for the first time, attempt to send the user an email.

보호된 메소드들

메소드 설명
getAttributes ( Flarum\Core\Notification\BlueprintInterface $blueprint ) : array Construct an array of attributes to be stored in a notification record in the database, given a notification blueprint.
mailNotifications ( Flarum\Core\Notification\MailableInterface $blueprint, array $recipients ) Mail a notification to a list of users.
sendNotifications ( Flarum\Core\Notification\BlueprintInterface $blueprint, array $recipients ) Create a notification record and send an email (depending on user preference) from a blueprint to a list of recipients.
setDeleted ( array $ids, boolean $isDeleted ) Set the deleted status of a list of notification records.

메소드 상세

__construct() 공개 메소드

public __construct ( NotificationRepository $notifications, NotificationMailer $mailer )
$notifications Flarum\Core\Repository\NotificationRepository
$mailer NotificationMailer

delete() 공개 메소드

Delete a notification for all users.
public delete ( Flarum\Core\Notification\BlueprintInterface $blueprint ) : void
$blueprint Flarum\Core\Notification\BlueprintInterface
리턴 void

getAttributes() 보호된 메소드

Construct an array of attributes to be stored in a notification record in the database, given a notification blueprint.
protected getAttributes ( Flarum\Core\Notification\BlueprintInterface $blueprint ) : array
$blueprint Flarum\Core\Notification\BlueprintInterface
리턴 array

mailNotifications() 보호된 메소드

Mail a notification to a list of users.
protected mailNotifications ( Flarum\Core\Notification\MailableInterface $blueprint, array $recipients )
$blueprint Flarum\Core\Notification\MailableInterface
$recipients array

onePerUser() 공개 메소드

Limit notifications to one per user for the entire duration of the given callback.
public onePerUser ( callable $callback ) : void
$callback callable
리턴 void

restore() 공개 메소드

Restore a notification for all users.
public restore ( Flarum\Core\Notification\BlueprintInterface $blueprint ) : void
$blueprint Flarum\Core\Notification\BlueprintInterface
리턴 void

sendNotifications() 보호된 메소드

Create a notification record and send an email (depending on user preference) from a blueprint to a list of recipients.
protected sendNotifications ( Flarum\Core\Notification\BlueprintInterface $blueprint, array $recipients )
$blueprint Flarum\Core\Notification\BlueprintInterface
$recipients array

setDeleted() 보호된 메소드

Set the deleted status of a list of notification records.
protected setDeleted ( array $ids, boolean $isDeleted )
$ids array
$isDeleted boolean

sync() 공개 메소드

Sync a notification so that it is visible to the specified users, and not visible to anyone else. If it is being made visible for the first time, attempt to send the user an email.
public sync ( Flarum\Core\Notification\BlueprintInterface $blueprint, array $users ) : void
$blueprint Flarum\Core\Notification\BlueprintInterface
$users array
리턴 void

프로퍼티 상세

$mailer 보호되어 있는 프로퍼티

protected NotificationMailer,Flarum\Core\Notification $mailer
리턴 NotificationMailer

$notifications 보호되어 있는 프로퍼티

protected NotificationRepository,Flarum\Core\Repository $notifications
리턴 Flarum\Core\Repository\NotificationRepository

$onePerUser 보호되어 있는 정적으로 프로퍼티

Whether or not notifications are being limited to one per user.
protected static bool $onePerUser
리턴 boolean

$sentTo 보호되어 있는 정적으로 프로퍼티

An internal list of user IDs that notifications have been sent to.
protected static int[] $sentTo
리턴 int[]