|
2 | 2 |
|
3 | 3 | namespace BNETDocs\Models\Document; |
4 | 4 |
|
5 | | -class Edit extends \BNETDocs\Models\ActiveUser |
| 5 | +class Edit extends \BNETDocs\Models\ActiveUser implements \JsonSerializable |
6 | 6 | { |
7 | | - public bool $acl_allowed = false; |
8 | | - public ?string $brief = null; |
9 | | - public ?string $category = null; |
10 | | - public ?array $comments = null; |
11 | | - public ?string $content = null; |
12 | | - public ?\BNETDocs\Libraries\Document $document = null; |
13 | | - public ?int $document_id = null; |
14 | | - public ?bool $markdown = null; |
15 | | - public ?bool $published = null; |
16 | | - public ?string $title = null; |
| 7 | + public const ERROR_ACL_NOT_SET = 'ACL_NOT_SET'; |
| 8 | + public const ERROR_EMPTY_CONTENT = 'EMPTY_CONTENT'; |
| 9 | + public const ERROR_EMPTY_TITLE = 'EMPTY_TITLE'; |
| 10 | + public const ERROR_INTERNAL = 'INTERNAL_ERROR'; |
| 11 | + public const ERROR_NOT_FOUND = 'NOT_FOUND'; |
| 12 | + public const ERROR_NOT_LOGGED_IN = 'NOT_LOGGED_IN'; |
| 13 | + |
| 14 | + public bool $acl_allowed = false; |
| 15 | + public ?string $brief = null; |
| 16 | + public ?string $category = null; |
| 17 | + public ?array $comments = null; |
| 18 | + public ?string $content = null; |
| 19 | + public ?\BNETDocs\Libraries\Document $document = null; |
| 20 | + public ?int $document_id = null; |
| 21 | + public ?bool $markdown = null; |
| 22 | + public ?bool $published = null; |
| 23 | + public ?string $title = null; |
| 24 | + |
| 25 | + public function jsonSerialize(): mixed |
| 26 | + { |
| 27 | + return \array_merge(parent::jsonSerialize(), [ |
| 28 | + 'acl_allowed' => $this->acl_allowed, |
| 29 | + 'brief' => $this->brief, |
| 30 | + 'category' => $this->category, |
| 31 | + 'comments' => $this->comments, |
| 32 | + 'content' => $this->content, |
| 33 | + 'document' => $this->document, |
| 34 | + 'document_id' => $this->document_id, |
| 35 | + 'markdown' => $this->markdown, |
| 36 | + 'published' => $this->published, |
| 37 | + 'title' => $this->title, |
| 38 | + ]); |
| 39 | + } |
17 | 40 | } |
0 commit comments