mirror of
https://github.com/flarum/core.git
synced 2025-08-16 21:34:08 +02:00
Rename notification.sender
This commit is contained in:
@@ -30,7 +30,7 @@ class ListNotificationsController extends AbstractListController
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public $include = [
|
||||
'sender',
|
||||
'fromUser',
|
||||
'subject',
|
||||
'subject.discussion'
|
||||
];
|
||||
|
@@ -65,7 +65,7 @@ class NotificationSerializer extends AbstractSerializer
|
||||
* @param Notification $notification
|
||||
* @return \Tobscure\JsonApi\Relationship
|
||||
*/
|
||||
protected function sender($notification)
|
||||
protected function fromUser($notification)
|
||||
{
|
||||
return $this->hasOne($notification, BasicUserSerializer::class);
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ interface BlueprintInterface
|
||||
*
|
||||
* @return \Flarum\User\User|null
|
||||
*/
|
||||
public function getSender();
|
||||
public function getFromUser();
|
||||
|
||||
/**
|
||||
* Get the model that is the subject of this activity.
|
||||
|
@@ -32,7 +32,7 @@ class DiscussionRenamedBlueprint implements BlueprintInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getSender()
|
||||
public function getFromUser()
|
||||
{
|
||||
return $this->post->user;
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ use Flarum\User\User;
|
||||
*
|
||||
* @property int $id
|
||||
* @property int $user_id
|
||||
* @property int|null $sender_id
|
||||
* @property int|null $from_user_id
|
||||
* @property string $type
|
||||
* @property int|null $subject_id
|
||||
* @property mixed|null $data
|
||||
@@ -39,7 +39,7 @@ use Flarum\User\User;
|
||||
* @property \Carbon\Carbon $read_at
|
||||
* @property \Carbon\Carbon $deleted_at
|
||||
* @property \Flarum\User\User|null $user
|
||||
* @property \Flarum\User\User|null $sender
|
||||
* @property \Flarum\User\User|null $fromUser
|
||||
* @property \Flarum\Database\AbstractModel|null $subject
|
||||
*/
|
||||
class Notification extends AbstractModel
|
||||
|
@@ -226,7 +226,7 @@ class NotificationSyncer
|
||||
{
|
||||
return [
|
||||
'type' => $blueprint::getType(),
|
||||
'from_user_id' => ($sender = $blueprint->getSender()) ? $sender->id : null,
|
||||
'from_user_id' => ($fromUser = $blueprint->getFromUser()) ? $fromUser->id : null,
|
||||
'subject_id' => ($subject = $blueprint->getSubject()) ? $subject->id : null,
|
||||
'data' => ($data = $blueprint->getData()) ? json_encode($data) : null
|
||||
];
|
||||
|
Reference in New Issue
Block a user