From 61a907785d9382adeb2de05b4b080de1d270f6d0 Mon Sep 17 00:00:00 2001 From: polo Date: Sun, 19 Oct 2025 14:24:00 +0200 Subject: =?UTF-8?q?suppression=20champ=20file=5Fpath=5Fmini=20dans=20Asset?= =?UTF-8?q?,=20nettoyage=20divers,=20r=C3=A9solution=20bug=20quand=20pas?= =?UTF-8?q?=20d'image=20de=20fond?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/model/entities/Asset.php | 12 ++---------- src/model/entities/Node.php | 19 ------------------- 2 files changed, 2 insertions(+), 29 deletions(-) (limited to 'src/model/entities') diff --git a/src/model/entities/Asset.php b/src/model/entities/Asset.php index df8c98b..e1071b4 100644 --- a/src/model/entities/Asset.php +++ b/src/model/entities/Asset.php @@ -19,13 +19,10 @@ class Asset #[ORM\Column(type: "string", length: 255, unique: true)] // nom d'image UNIQUE private string $file_name; - // choisir un répertoire du genre /var/www/html/uploads/ de préférence hors de /src + // choisir un répertoire du genre /var/www/html/uploads/, au moins hors de /src #[ORM\Column(type: "string", length: 255, unique: true, nullable: true)] private ?string $file_path; - #[ORM\Column(type: "string", length: 255, unique: true, nullable: true)] - private ?string $file_path_mini; - #[ORM\Column(type: "string", length: 255, nullable: true)] private string $mime_type; // image/jpeg, image/png, etc @@ -44,11 +41,10 @@ class Asset #[ORM\ManyToMany(targetEntity: NodeData::class, mappedBy: "assets")] private $node_data; - public function __construct(string $name, ?string $path, ?string $path_mini, string $mime_type, string $alt) + public function __construct(string $name, ?string $path, string $mime_type, string $alt) { $this->file_name = $name; $this->file_path = $path; - $this->file_path_mini = $path_mini; $this->mime_type = $mime_type; $this->alt = $alt; } @@ -61,10 +57,6 @@ class Asset { return $this->file_path; } - public function getFilePathMini(): string - { - return $this->file_path_mini; - } public function getAlt(): string { return $this->alt; diff --git a/src/model/entities/Node.php b/src/model/entities/Node.php index 76ef74b..2034b3d 100644 --- a/src/model/entities/Node.php +++ b/src/model/entities/Node.php @@ -176,25 +176,6 @@ class Node $this->sortChildren(false); } } - - // remplacée par "ORDER BY a.date_time" en DQL - /*private function sortNews(bool $chrono = false) // affichage du plus récent au plus ancien par défaut - { - // tri par insertion similaire à Position::sortChildren - for($i = 1; $i < count($this->children); $i++){ - $tmp = $this->children[$i]; - $j = $i - 1; - - $compare = $chrono ? fn($a, $b) => $a > $b : fn($a, $b) => $a < $b; - - while($j >= 0 && $compare($this->children[$j]->getArticle()->getDateTime(), $tmp->getArticle()->getDateTime())){ - $this->children[$j + 1] = $this->children[$j]; - $j--; - } - $this->children[$j + 1] = $tmp; - } - }*/ - public function removeChild(self $child): void { foreach($this->children as $key => $object){ -- cgit v1.2.3