1 | <?php |
||
16 | class Page |
||
17 | { |
||
18 | public static $templates = [ |
||
19 | 'default' => 'default', |
||
20 | ]; |
||
21 | |||
22 | /** |
||
23 | * @var int|null |
||
24 | * |
||
25 | * @ORM\Column(type="integer") |
||
26 | * @ORM\Id |
||
27 | * @ORM\GeneratedValue(strategy="AUTO") |
||
28 | */ |
||
29 | protected $id; |
||
30 | |||
31 | /** |
||
32 | * @var string|null |
||
33 | * |
||
34 | * @ORM\Column(options={"default": "default"}) |
||
35 | * @Assert\NotBlank() |
||
36 | * @Assert\Regex(pattern="/^[ \w\-]+$/i") |
||
37 | */ |
||
38 | protected $template = 'default'; |
||
39 | |||
40 | /** |
||
41 | * @var string|null |
||
42 | * |
||
43 | * @ORM\Column(unique=true) |
||
44 | * @Assert\NotBlank() |
||
45 | * @Assert\Regex(pattern="/^[^\/][\w\/\-]+$/i") |
||
46 | * @Assert\Length(max=255) |
||
47 | * @AssertNoExistingRoute() |
||
48 | */ |
||
49 | protected $path; |
||
50 | |||
51 | /** |
||
52 | * @var string|null |
||
53 | * |
||
54 | * @ORM\Column() |
||
55 | * @Assert\NotBlank() |
||
56 | * @Assert\Length(max=255) |
||
57 | */ |
||
58 | protected $title; |
||
59 | |||
60 | /** |
||
61 | * @var string|null |
||
62 | * |
||
63 | * @ORM\Column(type="text") |
||
64 | * @Assert\NotBlank() |
||
65 | */ |
||
66 | protected $content; |
||
67 | |||
68 | public function __toString(): string |
||
72 | |||
73 | /** |
||
74 | * @return int|null |
||
75 | */ |
||
76 | public function getId() |
||
80 | |||
81 | public function setTemplate(?string $template): self |
||
87 | |||
88 | public function getTemplate(): ?string |
||
92 | |||
93 | public function setPath(?string $path): self |
||
99 | |||
100 | public function getPath(): ?string |
||
104 | |||
105 | public function setTitle(?string $title): self |
||
111 | |||
112 | public function getTitle(): ?string |
||
116 | |||
117 | public function setContent(?string $content): self |
||
123 | |||
124 | public function getContent(): ?string |
||
128 | } |
||
129 |