Category added

This commit is contained in:
Michael 2022-12-24 13:57:43 +00:00
parent bf4d321aa3
commit 8a7d08ae28
9 changed files with 35 additions and 20 deletions

View file

@ -42,6 +42,8 @@ class Report extends \Friendica\BaseEntity
protected $cid;
/** @var string Optional comment */
protected $comment;
/** @var string Optional category */
protected $category;
/** @var bool Whether this report should be forwarded to the remote server */
protected $forward;
/** @var \DateTime|null When the report was created */
@ -49,13 +51,14 @@ class Report extends \Friendica\BaseEntity
/** @var array Optional list of URI IDs of posts supporting the report*/
protected $postUriIds;
public function __construct(int $uid = null, int $reporterId, int $cid, \DateTime $created, string $comment = '', bool $forward = false, array $postUriIds = [], int $id = null)
public function __construct(int $uid = null, int $reporterId, int $cid, \DateTime $created, string $comment = '', string $category = null, bool $forward = false, array $postUriIds = [], int $id = null)
{
$this->uid = $uid;
$this->reporterId = $reporterId;
$this->cid = $cid;
$this->created = $created;
$this->comment = $comment;
$this->category = $category;
$this->forward = $forward;
$this->postUriIds = $postUriIds;
$this->id = $id;

View file

@ -40,6 +40,7 @@ class Report extends \Friendica\BaseFactory implements ICanCreateFromTableRow
$row['cid'],
new \DateTime($row['created'] ?? 'now', new \DateTimeZone('UTC')),
$row['comment'],
$row['category'],
$row['forward'],
$postUriIds,
$row['id'],
@ -60,7 +61,7 @@ class Report extends \Friendica\BaseFactory implements ICanCreateFromTableRow
* @return Entity\Report
* @throws \Exception
*/
public function createFromReportsRequest(int $uid = null, int $reporterId, int $cid, string $comment = '', bool $forward = false, array $postUriIds = []): Entity\Report
public function createFromReportsRequest(int $uid = null, int $reporterId, int $cid, string $comment = '', string $category = null, bool $forward = false, array $postUriIds = []): Entity\Report
{
return new Entity\Report(
$uid,
@ -68,6 +69,7 @@ class Report extends \Friendica\BaseFactory implements ICanCreateFromTableRow
$cid,
new \DateTime('now', new \DateTimeZone('UTC')),
$comment,
$category,
$forward,
$postUriIds,
);

View file

@ -57,6 +57,7 @@ class Report extends \Friendica\BaseRepository
'reporter-id' => $Report->reporterId,
'cid' => $Report->cid,
'comment' => $Report->comment,
'category' => $Report->category,
'forward' => $Report->forward,
];