diff options
Diffstat (limited to 'src/model/entities/NodeData.php')
| -rw-r--r-- | src/model/entities/NodeData.php | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/model/entities/NodeData.php b/src/model/entities/NodeData.php index c55f6a1..f6d6b01 100644 --- a/src/model/entities/NodeData.php +++ b/src/model/entities/NodeData.php | |||
| @@ -24,7 +24,7 @@ class NodeData | |||
| 24 | // inverseBy fait le lien avec $node_data dans Node (qui a "mappedBy") | 24 | // inverseBy fait le lien avec $node_data dans Node (qui a "mappedBy") |
| 25 | #[ORM\OneToOne(targetEntity: Node::class, inversedBy: "node_data")] | 25 | #[ORM\OneToOne(targetEntity: Node::class, inversedBy: "node_data")] |
| 26 | #[ORM\JoinColumn(name: "node_id", referencedColumnName: "id_node", onDelete: "CASCADE")] | 26 | #[ORM\JoinColumn(name: "node_id", referencedColumnName: "id_node", onDelete: "CASCADE")] |
| 27 | private Node $node; | 27 | private ?Node $node; |
| 28 | 28 | ||
| 29 | #[ORM\Column(type: "json")] | 29 | #[ORM\Column(type: "json")] |
| 30 | private array $data; | 30 | private array $data; |
| @@ -44,18 +44,12 @@ class NodeData | |||
| 44 | #[ORM\OneToMany(mappedBy: 'node_data', targetEntity: AssetEmployment::class, cascade: ['persist', 'remove'])] | 44 | #[ORM\OneToMany(mappedBy: 'node_data', targetEntity: AssetEmployment::class, cascade: ['persist', 'remove'])] |
| 45 | private Collection $asset_employment; | 45 | private Collection $asset_employment; |
| 46 | 46 | ||
| 47 | private int $nb_pages = 1; | ||
| 48 | private array $emails = []; // => noeud "show_emails" | 47 | private array $emails = []; // => noeud "show_emails" |
| 49 | 48 | ||
| 50 | public function __construct(array $data, Node $node, Collection $asset_employment = new ArrayCollection, ?string $presentation = null, ?bool $chrono_order = null) | 49 | public function __construct(array $data, Node $node, Collection $asset_employment = new ArrayCollection){ |
| 51 | { | ||
| 52 | $this->data = $data; | 50 | $this->data = $data; |
| 53 | $this->node = $node; | 51 | $this->node = $node; |
| 54 | $this->asset_employment = $asset_employment; | 52 | $this->asset_employment = $asset_employment; |
| 55 | if(!empty($presentation) && $presentation === 'grid'){ | ||
| 56 | $this->grid_cols_min_width = 250; | ||
| 57 | } | ||
| 58 | $this->chrono_order = $chrono_order ?? null; | ||
| 59 | } | 53 | } |
| 60 | 54 | ||
| 61 | public function getId(): int | 55 | public function getId(): int |
| @@ -82,7 +76,7 @@ class NodeData | |||
| 82 | } | 76 | } |
| 83 | 77 | ||
| 84 | // spécifique aux blocs contenant des articles | 78 | // spécifique aux blocs contenant des articles |
| 85 | public function getPresentation(): ?string | 79 | /*public function getPresentation(): ?string |
| 86 | { | 80 | { |
| 87 | return $this->presentation; | 81 | return $this->presentation; |
| 88 | } | 82 | } |
| @@ -117,6 +111,7 @@ class NodeData | |||
| 117 | { | 111 | { |
| 118 | $this->pagination_limit = $pagination_limit; | 112 | $this->pagination_limit = $pagination_limit; |
| 119 | } | 113 | } |
| 114 | private int $nb_pages = 1; | ||
| 120 | public function getNumberOfPages(): int | 115 | public function getNumberOfPages(): int |
| 121 | { | 116 | { |
| 122 | return $this->nb_pages; | 117 | return $this->nb_pages; |
| @@ -124,13 +119,12 @@ class NodeData | |||
| 124 | public function setNumberOfPages(int $nb_pages): void | 119 | public function setNumberOfPages(int $nb_pages): void |
| 125 | { | 120 | { |
| 126 | $this->nb_pages = $nb_pages; | 121 | $this->nb_pages = $nb_pages; |
| 127 | } | 122 | }*/ |
| 128 | 123 | ||
| 129 | /*public function setNode(Node $node): void | 124 | public function setNode(?Node $node): void |
| 130 | { | 125 | { |
| 131 | $this->node = $node; | 126 | $this->node = $node; |
| 132 | }*/ | 127 | } |
| 133 | |||
| 134 | 128 | ||
| 135 | public function getNodeDataAssets(): Collection | 129 | public function getNodeDataAssets(): Collection |
| 136 | { | 130 | { |
