Flarum\Core\Notification\NotificationSyncer::getAttributes PHP Method

getAttributes() protected method

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
return array
    protected function getAttributes(BlueprintInterface $blueprint)
    {
        return ['type' => $blueprint::getType(), 'sender_id' => ($sender = $blueprint->getSender()) ? $sender->id : null, 'subject_id' => ($subject = $blueprint->getSubject()) ? $subject->id : null, 'data' => ($data = $blueprint->getData()) ? json_encode($data) : null];
    }