data = $data; $this->node = $node; $this->images = $images; if(!empty($presentation) && $presentation === 'grid'){ $this->grid_cols_min_width = 250; } $this->chrono_order = $chrono_order ?? null; } public function getId(): int { return $this->id_node_data; } public function getData(): array { return $this->data; } /*public function setData(array $data): void // entrée = tableau associatif { $this->data = $data; }*/ public function updateData(string $key, string $value = ''): void { if($value !== ''){ $this->data[$key] = $value; } // si $value est vide, supprime la clé elseif(isset($this->data[$key])){ unset($this->data[$key]); } } // spécifique aux blocs contenant des articles public function getPresentation(): ?string { return $this->presentation; } public function setPresentation(string $presentation): void { $this->presentation = $presentation; } public function getColsMinWidth(): int { $default = 320; // pixels return $this->grid_cols_min_width === null ? $default : $this->grid_cols_min_width; } public function setColsMinWidth(int $columns): void { $this->grid_cols_min_width = $columns; } public function getChronoOrder(): bool { return $this->chrono_order ?? false; } public function setChronoOrder(bool $reverse_order): void { $this->chrono_order = $reverse_order; } public function getPaginationLimit(): ?int { return $this->pagination_limit ?? null; } /*public function setNode(Node $node): void { $this->node = $node; }*/ public function getImages(): Collection { return $this->images; } public function setImages(Collection $images): void { $this->images = $images; } }