From 04d571cc888e7e48aa4e78f744417b8766cbb5a6 Mon Sep 17 00:00:00 2001 From: Kevin MONDEJAR Date: Wed, 23 Oct 2024 15:14:42 +0200 Subject: [PATCH] Supprimer 'models/CitationModel.php' --- models/CitationModel.php | 45 ---------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 models/CitationModel.php diff --git a/models/CitationModel.php b/models/CitationModel.php deleted file mode 100644 index fc14eab..0000000 --- a/models/CitationModel.php +++ /dev/null @@ -1,45 +0,0 @@ -filePath)) { - return null; - } - - $citations = file($this->filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - foreach ($citations as $citation) { - $parts = explode(';', $citation); - // Vérifier si la citation commence par 'µ' - if (strpos(trim($parts[0]), 'µ') === 0) { - return $parts; // Retourne la citation du jour - } - } - return null; - } - - // Fonction pour obtenir les suggestions de citations - public function getSuggestions($citationDuJour) { - if (!file_exists($this->filePath)) { - return []; - } - - $citations = file($this->filePath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - $suggestions = []; - - foreach ($citations as $citation) { - $parts = explode(';', $citation); - // On ajoute la citation si elle n'est pas la citation du jour - if (!($parts[0] === $citationDuJour[0])) { - $suggestions[] = $parts; - } - } - - // Limiter à 10 suggestions - shuffle($suggestions); - return array_slice($suggestions, 0, 10); - } -}