diff options
Diffstat (limited to 'src/model/entities/NodeData.php')
| -rw-r--r-- | src/model/entities/NodeData.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/model/entities/NodeData.php b/src/model/entities/NodeData.php index 99dda83..0d42f3a 100644 --- a/src/model/entities/NodeData.php +++ b/src/model/entities/NodeData.php | |||
| @@ -30,7 +30,10 @@ class NodeData | |||
| 30 | #[ORM\Column(type: "string", length: 255, nullable: true)] | 30 | #[ORM\Column(type: "string", length: 255, nullable: true)] |
| 31 | private ?string $presentation; | 31 | private ?string $presentation; |
| 32 | 32 | ||
| 33 | #[ORM\Column(type: "integer", length: 255, nullable: true)] | 33 | #[ORM\Column(type: "boolean", length: 255, nullable: true)] |
| 34 | private ?bool $chrono_order = null; | ||
| 35 | |||
| 36 | #[ORM\Column(type: "integer", nullable: true)] | ||
| 34 | private ?int $grid_cols_min_width = null; // pour le mode grille | 37 | private ?int $grid_cols_min_width = null; // pour le mode grille |
| 35 | 38 | ||
| 36 | // liaison avec table intermédiaire | 39 | // liaison avec table intermédiaire |
| @@ -42,7 +45,7 @@ class NodeData | |||
| 42 | )] | 45 | )] |
| 43 | private Collection $images; | 46 | private Collection $images; |
| 44 | 47 | ||
| 45 | public function __construct(array $data, Node $node, Collection $images = new ArrayCollection, string $presentation = null) | 48 | public function __construct(array $data, Node $node, Collection $images = new ArrayCollection, ?string $presentation = null, ?bool $chrono_order = null) |
| 46 | { | 49 | { |
| 47 | $this->data = $data; | 50 | $this->data = $data; |
| 48 | $this->node = $node; | 51 | $this->node = $node; |
| @@ -50,6 +53,7 @@ class NodeData | |||
| 50 | if(!empty($presentation) && $presentation === 'grid'){ | 53 | if(!empty($presentation) && $presentation === 'grid'){ |
| 51 | $this->grid_cols_min_width = 250; | 54 | $this->grid_cols_min_width = 250; |
| 52 | } | 55 | } |
| 56 | $this->chrono_order = $chrono_order ?? null; | ||
| 53 | } | 57 | } |
| 54 | 58 | ||
| 55 | public function getId(): int | 59 | public function getId(): int |
| @@ -60,7 +64,7 @@ class NodeData | |||
| 60 | { | 64 | { |
| 61 | return $this->data; | 65 | return $this->data; |
| 62 | } | 66 | } |
| 63 | /*public function setData(array $data): void | 67 | /*public function setData(array $data): void // entrée = tableau associatif |
| 64 | { | 68 | { |
| 65 | $this->data = $data; | 69 | $this->data = $data; |
| 66 | }*/ | 70 | }*/ |
| @@ -74,6 +78,8 @@ class NodeData | |||
| 74 | unset($this->data[$key]); | 78 | unset($this->data[$key]); |
| 75 | } | 79 | } |
| 76 | } | 80 | } |
| 81 | |||
| 82 | // spécifique aux blocs contenant des articles | ||
| 77 | public function getPresentation(): ?string | 83 | public function getPresentation(): ?string |
| 78 | { | 84 | { |
| 79 | return $this->presentation; | 85 | return $this->presentation; |
| @@ -91,6 +97,14 @@ class NodeData | |||
| 91 | { | 97 | { |
| 92 | $this->grid_cols_min_width = $columns; | 98 | $this->grid_cols_min_width = $columns; |
| 93 | } | 99 | } |
| 100 | public function getChronoOrder(): bool | ||
| 101 | { | ||
| 102 | return $this->chrono_order ?? false; | ||
| 103 | } | ||
| 104 | public function setChronoOrder(bool $reverse_order): void | ||
| 105 | { | ||
| 106 | $this->chrono_order = $reverse_order; | ||
| 107 | } | ||
| 94 | 108 | ||
| 95 | /*public function setNode(Node $node): void | 109 | /*public function setNode(Node $node): void |
| 96 | { | 110 | { |
