aboutsummaryrefslogtreecommitdiff
path: root/src/model/entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/entities')
-rw-r--r--src/model/entities/NodeData.php58
-rw-r--r--src/model/entities/Presentation.php6
2 files changed, 4 insertions, 60 deletions
diff --git a/src/model/entities/NodeData.php b/src/model/entities/NodeData.php
index f6d6b01..1646c92 100644
--- a/src/model/entities/NodeData.php
+++ b/src/model/entities/NodeData.php
@@ -29,18 +29,6 @@ class NodeData
29 #[ORM\Column(type: "json")] 29 #[ORM\Column(type: "json")]
30 private array $data; 30 private array $data;
31 31
32 #[ORM\Column(type: "string", length: 255, nullable: true)]
33 private ?string $presentation;
34
35 #[ORM\Column(type: "boolean", length: 255, nullable: true)]
36 private ?bool $chrono_order = null;
37
38 #[ORM\Column(type: "integer", nullable: true)]
39 private ?int $grid_cols_min_width = null; // pour le mode grille
40
41 #[ORM\Column(type: "integer", nullable: true)]
42 private ?int $pagination_limit = null; // pour les post_block et news_block
43
44 #[ORM\OneToMany(mappedBy: 'node_data', targetEntity: AssetEmployment::class, cascade: ['persist', 'remove'])] 32 #[ORM\OneToMany(mappedBy: 'node_data', targetEntity: AssetEmployment::class, cascade: ['persist', 'remove'])]
45 private Collection $asset_employment; 33 private Collection $asset_employment;
46 34
@@ -74,52 +62,6 @@ class NodeData
74 unset($this->data[$key]); 62 unset($this->data[$key]);
75 } 63 }
76 } 64 }
77
78 // spécifique aux blocs contenant des articles
79 /*public function getPresentation(): ?string
80 {
81 return $this->presentation;
82 }
83 public function setPresentation(string $presentation): void
84 {
85 $this->presentation = $presentation;
86 }
87 public function getColsMinWidth(): int
88 {
89 $default = 320; // pixels
90 return $this->grid_cols_min_width === null ? $default : $this->grid_cols_min_width;
91 }
92 public function setColsMinWidth(int $columns): void
93 {
94 $this->grid_cols_min_width = $columns;
95 }
96 public function getChronoOrder(): bool
97 {
98 return $this->chrono_order ?? false;
99 }
100 public function setChronoOrder(bool $reverse_order): void
101 {
102 $this->chrono_order = $reverse_order;
103 }
104
105 public function getPaginationLimit(): ?int
106 {
107 $default = 12; // si 0 pas de pagination, 12 rend bien avec des grilles de 2, 3 ou 4 colonnes
108 return $this->pagination_limit === null ? $default : $this->pagination_limit;
109 }
110 public function setPaginationLimit(int $pagination_limit): void
111 {
112 $this->pagination_limit = $pagination_limit;
113 }
114 private int $nb_pages = 1;
115 public function getNumberOfPages(): int
116 {
117 return $this->nb_pages;
118 }
119 public function setNumberOfPages(int $nb_pages): void
120 {
121 $this->nb_pages = $nb_pages;
122 }*/
123 65
124 public function setNode(?Node $node): void 66 public function setNode(?Node $node): void
125 { 67 {
diff --git a/src/model/entities/Presentation.php b/src/model/entities/Presentation.php
index 912c19e..d66bf24 100644
--- a/src/model/entities/Presentation.php
+++ b/src/model/entities/Presentation.php
@@ -119,11 +119,13 @@ class Presentation{
119 $this->nb_pages = $nb_pages; 119 $this->nb_pages = $nb_pages;
120 } 120 }
121 121
122 static public array $blocks = ['post_block' => 'Articles libres', 'news_block' => 'Actualités', 122
123 /* -- blocs et présentations disponibles dans l'application -- */
124 const BLOCKS = ['post_block' => 'Articles libres', 'news_block' => 'Actualités',
123 //'galery' => 'Galerie', 125 //'galery' => 'Galerie',
124 'calendar' => 'Calendrier', 'form' => 'Formulaire' 126 'calendar' => 'Calendrier', 'form' => 'Formulaire'
125 ]; 127 ];
126 static public array $presentations = ['fullwidth' => 'Pleine largeur', 'grid' => 'Grille', 'mosaic' => 'Mosaïque' 128 const PRESENTATIONS = ['fullwidth' => 'Pleine largeur', 'grid' => 'Grille', 'mosaic' => 'Mosaïque'
127 //, 'carousel' => 'Carrousel' 129 //, 'carousel' => 'Carrousel'
128 ]; 130 ];
129 static public function hasPresentation(string $block): bool 131 static public function hasPresentation(string $block): bool