diff options
Diffstat (limited to 'src/model/entities/Node.php')
| -rw-r--r-- | src/model/entities/Node.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/model/entities/Node.php b/src/model/entities/Node.php index c3e4ec3..fb2d867 100644 --- a/src/model/entities/Node.php +++ b/src/model/entities/Node.php | |||
| @@ -98,6 +98,8 @@ class Node | |||
| 98 | { | 98 | { |
| 99 | $this->page = $page; | 99 | $this->page = $page; |
| 100 | }*/ | 100 | }*/ |
| 101 | |||
| 102 | // utiliser l'interface de NodeData et EmailForm | ||
| 101 | public function getArticle(): Article | 103 | public function getArticle(): Article |
| 102 | { | 104 | { |
| 103 | return $this->article; | 105 | return $this->article; |
| @@ -106,9 +108,13 @@ class Node | |||
| 106 | { | 108 | { |
| 107 | $this->article = $article; | 109 | $this->article = $article; |
| 108 | }*/ | 110 | }*/ |
| 111 | |||
| 109 | // une interface serait cool! | 112 | // une interface serait cool! |
| 113 | // OU possible un "héritage doctrine", faire en sorte que Node soit la mère de NodeData, EmailForm, Article... | ||
| 114 | // une seulle instance est matérialisée par plusieurs tables en même temps | ||
| 110 | public function getNodeData(): NodeData|EmailForm|null | 115 | public function getNodeData(): NodeData|EmailForm|null |
| 111 | { | 116 | { |
| 117 | // limite du polymorphisme avec doctrine => impossible d'avoir une unique variable $node_data | ||
| 112 | return $this->name_node === 'form' ? $this->email_form : $this->node_data; | 118 | return $this->name_node === 'form' ? $this->email_form : $this->node_data; |
| 113 | } | 119 | } |
| 114 | public function getChildren(): array | 120 | public function getChildren(): array |
