|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Modules\Entitizer\Form { |
|
4
|
|
|
|
|
5
|
|
|
use Modules\Entitizer, Utils\Form, Utils\Lister; |
|
6
|
|
|
|
|
7
|
|
|
class Page extends Form { |
|
8
|
|
|
|
|
9
|
|
|
# Constructor |
|
10
|
|
|
|
|
11
|
|
|
public function __construct(Entitizer\Entity\Page $page) { |
|
12
|
|
|
|
|
13
|
|
|
parent::__construct(ENTITY_TYPE_PAGE); |
|
14
|
|
|
|
|
15
|
|
|
# Add fields |
|
16
|
|
|
|
|
17
|
|
|
$this->addText('parent_id', $page->parent_id, FORM_FIELD_HIDDEN); |
|
|
|
|
|
|
18
|
|
|
|
|
19
|
|
|
$this->addText('title', $page->title, FORM_FIELD_TEXT, CONFIG_PAGE_TITLE_MAX_LENGTH, ['required' => true]); |
|
|
|
|
|
|
20
|
|
|
|
|
21
|
|
|
$this->addText('name', $page->name, FORM_FIELD_TEXT, CONFIG_PAGE_NAME_MAX_LENGTH, ['required' => true, 'convert' => 'url']); |
|
|
|
|
|
|
22
|
|
|
|
|
23
|
|
|
$this->addSelect('visibility', $page->visibility, Lister\Visibility::list()); |
|
|
|
|
|
|
24
|
|
|
|
|
25
|
|
|
$this->addSelect('access', $page->access, Lister\Access::list()); |
|
|
|
|
|
|
26
|
|
|
|
|
27
|
|
|
$this->addText('description', $page->description, FORM_FIELD_TEXTAREA, CONFIG_PAGE_DESCRIPTION_MAX_LENGTH); |
|
|
|
|
|
|
28
|
|
|
|
|
29
|
|
|
$this->addText('keywords', $page->keywords, FORM_FIELD_TEXTAREA, CONFIG_PAGE_KEYWORDS_MAX_LENGTH); |
|
|
|
|
|
|
30
|
|
|
|
|
31
|
|
|
$this->addCheckbox('robots_index', $page->robots_index); |
|
|
|
|
|
|
32
|
|
|
|
|
33
|
|
|
$this->addCheckbox('robots_follow', $page->robots_follow); |
|
|
|
|
|
|
34
|
|
|
|
|
35
|
|
|
$this->addText('contents', $page->contents, FORM_FIELD_TEXTAREA, 0, ['multiline' => true, 'codestyle' => true]); |
|
|
|
|
|
|
36
|
|
|
} |
|
37
|
|
|
} |
|
38
|
|
|
} |
|
39
|
|
|
|
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.