diff options
| author | polo <ordipolo@gmx.fr> | 2025-09-09 15:37:50 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-09-09 15:37:50 +0200 |
| commit | 5e41bea598ff38b3c520b69fd92ee3412e716df2 (patch) | |
| tree | b4b57a7201db1efe484446383042f9a43fd2deff /src/model/entities/Node.php | |
| parent | c5d9df5c42b5d2522e2a06b5f40422c1bbf497ab (diff) | |
| download | cms-5e41bea598ff38b3c520b69fd92ee3412e716df2.tar.gz cms-5e41bea598ff38b3c520b69fd92ee3412e716df2.tar.bz2 cms-5e41bea598ff38b3c520b69fd92ee3412e716df2.zip | |
fin de l'utilisation du champ article_timestamp de la table node, résolue erreur lorsque deux news sont créées dans la même minute (pas dans la même seconde par contre)
Diffstat (limited to 'src/model/entities/Node.php')
| -rw-r--r-- | src/model/entities/Node.php | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/model/entities/Node.php b/src/model/entities/Node.php index 7cf395c..eb73116 100644 --- a/src/model/entities/Node.php +++ b/src/model/entities/Node.php | |||
| @@ -17,7 +17,7 @@ class Node | |||
| 17 | #[ORM\Id] | 17 | #[ORM\Id] |
| 18 | #[ORM\GeneratedValue] | 18 | #[ORM\GeneratedValue] |
| 19 | #[ORM\Column(type: "integer")] | 19 | #[ORM\Column(type: "integer")] |
| 20 | private int $id_node; | 20 | private ?int $id_node = null; |
| 21 | 21 | ||
| 22 | #[ORM\Column(type: "string", length: 255)] | 22 | #[ORM\Column(type: "string", length: 255)] |
| 23 | private string $name_node; | 23 | private string $name_node; |
| @@ -52,16 +52,14 @@ class Node | |||
| 52 | private ?NodeData $node_data = null; | 52 | private ?NodeData $node_data = null; |
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | // -- fin des attributs destinés à doctrine, début du code utilisateur -- | 55 | // attributs non destinés à doctrine |
| 56 | |||
| 57 | private array $children = []; // tableau de Node | 56 | private array $children = []; // tableau de Node |
| 58 | private ?self $adopted = null; // = "new" est un enfant de "main" lorsque la page est "article" | 57 | private ?self $adopted = null; // = "new" est un enfant de "main" lorsque la page est "article" |
| 59 | static private array $default_attributes = ['css_array' => ['body', 'head', 'nav', 'foot'],'js_array' => ['main']]; | 58 | static private array $default_attributes = ['css_array' => ['body', 'head', 'nav', 'foot'],'js_array' => ['main']]; |
| 60 | 59 | ||
| 61 | public function __construct(string $name = '', ?string $article_timestamp = null, array $attributes = [], int $position = 0, ?self $parent = null, ?Page $page = null, ?Article $article = null) | 60 | public function __construct(string $name = '', array $attributes = [], int $position = 0, ?self $parent = null, ?Page $page = null, ?Article $article = null) |
| 62 | { | 61 | { |
| 63 | $this->name_node = $name; | 62 | $this->name_node = $name; |
| 64 | $this->article_timestamp = $article_timestamp; | ||
| 65 | $this->attributes = $attributes; | 63 | $this->attributes = $attributes; |
| 66 | $this->position = $position; | 64 | $this->position = $position; |
| 67 | $this->parent = $parent; | 65 | $this->parent = $parent; |
| @@ -70,7 +68,7 @@ class Node | |||
| 70 | } | 68 | } |
| 71 | 69 | ||
| 72 | // pfff... | 70 | // pfff... |
| 73 | public function getId(): int | 71 | public function getId(): ?int |
| 74 | { | 72 | { |
| 75 | return $this->id_node; | 73 | return $this->id_node; |
| 76 | } | 74 | } |
