create comment classes
This commit is contained in:
parent
cd1f065962
commit
f5ffe312e2
8 changed files with 246 additions and 63 deletions
24
public/site/plugins/comments/src/Comment.php
Normal file
24
public/site/plugins/comments/src/Comment.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace adrienpayet\comments;
|
||||
|
||||
class Comment extends BaseComment
|
||||
{
|
||||
protected $position;
|
||||
|
||||
public function __construct($data) {
|
||||
parent::__construct($data);
|
||||
$this->position = $data['position'] ?? null;
|
||||
}
|
||||
|
||||
public function position() {
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function toArray() {
|
||||
$array = parent::toArray();
|
||||
$array['position'] = $this->position;
|
||||
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue