diff options
Diffstat (limited to 'src/model/entities/NodeData.php')
-rw-r--r-- | src/model/entities/NodeData.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/model/entities/NodeData.php b/src/model/entities/NodeData.php index 3688e4a..99dda83 100644 --- a/src/model/entities/NodeData.php +++ b/src/model/entities/NodeData.php | |||
@@ -27,9 +27,8 @@ class NodeData | |||
27 | #[ORM\Column(type: "json")] | 27 | #[ORM\Column(type: "json")] |
28 | private array $data; | 28 | private array $data; |
29 | 29 | ||
30 | #[ORM\ManyToOne(targetEntity: Presentation::class)] | 30 | #[ORM\Column(type: "string", length: 255, nullable: true)] |
31 | #[ORM\JoinColumn(name: "presentation_id", referencedColumnName: "id_presentation", nullable: true)] | 31 | private ?string $presentation; |
32 | private ?Presentation $presentation; | ||
33 | 32 | ||
34 | #[ORM\Column(type: "integer", length: 255, nullable: true)] | 33 | #[ORM\Column(type: "integer", length: 255, nullable: true)] |
35 | private ?int $grid_cols_min_width = null; // pour le mode grille | 34 | private ?int $grid_cols_min_width = null; // pour le mode grille |
@@ -43,12 +42,12 @@ class NodeData | |||
43 | )] | 42 | )] |
44 | private Collection $images; | 43 | private Collection $images; |
45 | 44 | ||
46 | public function __construct(array $data, Node $node, Collection $images = new ArrayCollection, Presentation $presentation = null) | 45 | public function __construct(array $data, Node $node, Collection $images = new ArrayCollection, string $presentation = null) |
47 | { | 46 | { |
48 | $this->data = $data; | 47 | $this->data = $data; |
49 | $this->node = $node; | 48 | $this->node = $node; |
50 | $this->images = $images; | 49 | $this->images = $images; |
51 | if(!empty($presentation) && $presentation->getName() === 'grid'){ | 50 | if(!empty($presentation) && $presentation === 'grid'){ |
52 | $this->grid_cols_min_width = 250; | 51 | $this->grid_cols_min_width = 250; |
53 | } | 52 | } |
54 | } | 53 | } |
@@ -75,11 +74,11 @@ class NodeData | |||
75 | unset($this->data[$key]); | 74 | unset($this->data[$key]); |
76 | } | 75 | } |
77 | } | 76 | } |
78 | public function getPresentation(): ?Presentation | 77 | public function getPresentation(): ?string |
79 | { | 78 | { |
80 | return $this->presentation; | 79 | return $this->presentation; |
81 | } | 80 | } |
82 | public function setPresentation(Presentation $presentation): void | 81 | public function setPresentation(string $presentation): void |
83 | { | 82 | { |
84 | $this->presentation = $presentation; | 83 | $this->presentation = $presentation; |
85 | } | 84 | } |