diff options
author | polo <ordipolo@gmx.fr> | 2025-10-03 02:28:22 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2025-10-03 02:28:22 +0200 |
commit | d6d7351259e104ab10b5dda3483c281830ce4ff3 (patch) | |
tree | ec555bcbade2ceaa348f3108e585af1273a0c94a /src/model/entities | |
parent | f5cb6249dfb339f8e48e49dc131c6efa09c92ecc (diff) | |
download | cms-d6d7351259e104ab10b5dda3483c281830ce4ff3.zip |
pagination partie 1, ordre des articles avec ORDER BY, optimisations dans ViewController
Diffstat (limited to 'src/model/entities')
-rw-r--r-- | src/model/entities/Node.php | 6 | ||||
-rw-r--r-- | src/model/entities/NodeData.php | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/model/entities/Node.php b/src/model/entities/Node.php index f7af6de..ec5f081 100644 --- a/src/model/entities/Node.php +++ b/src/model/entities/Node.php | |||
@@ -172,11 +172,7 @@ class Node | |||
172 | { | 172 | { |
173 | $this->children[] = $child; | 173 | $this->children[] = $child; |
174 | 174 | ||
175 | // cas particulier des news: utilise les dates au lieu des positions (les positions existent mais sont ignorées) | 175 | if(!\Blocks::hasPresentation($this->getName())){ // post_block et news_block ont leurs enfants ordonnés avec ORDER BY |
176 | if($this->getName() === 'news_block'){ | ||
177 | $this->sortNews($this->getNodeData()->getChronoOrder() ?? false); // faux = ordre chronologique | ||
178 | } | ||
179 | else{ | ||
180 | $this->sortChildren(false); | 176 | $this->sortChildren(false); |
181 | } | 177 | } |
182 | } | 178 | } |
diff --git a/src/model/entities/NodeData.php b/src/model/entities/NodeData.php index 0d42f3a..1d7db4c 100644 --- a/src/model/entities/NodeData.php +++ b/src/model/entities/NodeData.php | |||
@@ -36,6 +36,9 @@ class NodeData | |||
36 | #[ORM\Column(type: "integer", nullable: true)] | 36 | #[ORM\Column(type: "integer", nullable: true)] |
37 | private ?int $grid_cols_min_width = null; // pour le mode grille | 37 | private ?int $grid_cols_min_width = null; // pour le mode grille |
38 | 38 | ||
39 | #[ORM\Column(type: "integer", nullable: true)] | ||
40 | private ?int $pagination_limit = null; // pour les post_block et news_block | ||
41 | |||
39 | // liaison avec table intermédiaire | 42 | // liaison avec table intermédiaire |
40 | #[ORM\ManyToMany(targetEntity: Image::class, inversedBy: "node_data")] | 43 | #[ORM\ManyToMany(targetEntity: Image::class, inversedBy: "node_data")] |
41 | #[ORM\JoinTable( | 44 | #[ORM\JoinTable( |
@@ -105,6 +108,11 @@ class NodeData | |||
105 | { | 108 | { |
106 | $this->chrono_order = $reverse_order; | 109 | $this->chrono_order = $reverse_order; |
107 | } | 110 | } |
111 | |||
112 | public function getPaginationLimit(): ?int | ||
113 | { | ||
114 | return $this->pagination_limit ?? null; | ||
115 | } | ||
108 | 116 | ||
109 | /*public function setNode(Node $node): void | 117 | /*public function setNode(Node $node): void |
110 | { | 118 | { |