change notifications structure from object to array
This commit is contained in:
parent
0d25794b87
commit
20824983a6
8 changed files with 64 additions and 50 deletions
|
|
@ -9,7 +9,7 @@ class BaseComment {
|
|||
protected $position;
|
||||
protected $replies;
|
||||
protected $text;
|
||||
protected $user;
|
||||
protected $author;
|
||||
protected $date;
|
||||
protected $id;
|
||||
protected $type;
|
||||
|
|
@ -21,7 +21,7 @@ class BaseComment {
|
|||
$filePageIndex = $data['filePageIndex'];
|
||||
$replies = $data['replies'] ?? [];
|
||||
$text = $data['text'];
|
||||
$user = $data['user'];
|
||||
$author = $data['author'];
|
||||
$date = $data['date'];
|
||||
$id = $data['id'];
|
||||
$type = $data['type'] ?? 'comment';
|
||||
|
|
@ -36,11 +36,11 @@ class BaseComment {
|
|||
];
|
||||
$this->replies = $replies ?? [];
|
||||
$this->text = $text;
|
||||
$this->user = [
|
||||
'name' => (string) $user->name(),
|
||||
'email' => (string) $user->email(),
|
||||
'uuid' => (string) $user->uuid(),
|
||||
'role' => (string) $user->role(),
|
||||
$this->author = [
|
||||
'name' => (string) $author->name(),
|
||||
'email' => (string) $author->email(),
|
||||
'uuid' => (string) $author->uuid(),
|
||||
'role' => (string) $author->role(),
|
||||
];
|
||||
$this->date = $date;
|
||||
$this->id = $id;
|
||||
|
|
@ -64,8 +64,8 @@ class BaseComment {
|
|||
return $this->text;
|
||||
}
|
||||
|
||||
public function user() {
|
||||
return $this->user;
|
||||
public function author() {
|
||||
return $this->author;
|
||||
}
|
||||
|
||||
public function date() {
|
||||
|
|
@ -100,7 +100,7 @@ class BaseComment {
|
|||
'file' => $this->file,
|
||||
'replies' => $this->replies,
|
||||
'text' => $this->text,
|
||||
'user' => $this->user,
|
||||
'author' => $this->author,
|
||||
'date' => $this->date,
|
||||
'id' => $this->id,
|
||||
'type' => $this->type,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue