aboutsummaryrefslogtreecommitdiff
path: root/src/model/entities/Page.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/entities/Page.php')
-rw-r--r--src/model/entities/Page.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/model/entities/Page.php b/src/model/entities/Page.php
index 5b54ae6..3e90dbc 100644
--- a/src/model/entities/Page.php
+++ b/src/model/entities/Page.php
@@ -31,6 +31,23 @@ class Page
31 #[ORM\Column(type: "text")] 31 #[ORM\Column(type: "text")]
32 private string $description; 32 private string $description;
33 33
34 #[ORM\Column(type: "json", nullable: true)]
35 private ?array $css = null;
36
37 #[ORM\Column(type: "json", nullable: true)]
38 private ?array $js = null;
39
40 static private array $default_css = ['body', 'head', 'nav', 'foot'];
41 static private array $default_js = ['main'];
42
43 /* remplissage
44 UPDATE nb_page
45 JOIN nb_node ON nb_node.page_id = nb_page.id_page
46 SET nb_page.css = JSON_EXTRACT(nb_node.attributes, '$.css_array');
47 UPDATE nb_page
48 JOIN nb_node ON nb_node.page_id = nb_page.id_page
49 SET nb_page.js = JSON_EXTRACT(nb_node.attributes, '$.js_array'); */
50
34 #[ORM\Column(type: "boolean")] 51 #[ORM\Column(type: "boolean")]
35 private bool $reachable; 52 private bool $reachable;
36 53
@@ -103,6 +120,30 @@ class Page
103 { 120 {
104 $this->description = $description; 121 $this->description = $description;
105 } 122 }
123 public function getCSS(): array
124 {
125 return $this->css;
126 }
127 public function useDefaultCSS(): void
128 {
129 $this->css = self::$default_css;
130 }
131 public function setCSS(array $css): void
132 {
133 $this->css = $css;
134 }
135 public function getJS(): array
136 {
137 return $this->js;
138 }
139 public function useDefaultJS(): void
140 {
141 $this->js = self::$default_js;
142 }
143 public function setJS(array $js): void
144 {
145 $this->js = $js;
146 }
106 public function isReachable(): bool 147 public function isReachable(): bool
107 { 148 {
108 return $this->reachable; 149 return $this->reachable;