From f19db76cc3b21785619ffd24bfb34692a3aaa66a Mon Sep 17 00:00:00 2001 From: polo Date: Thu, 24 Feb 2022 02:29:14 +0100 Subject: recursiveIterator --- model/Album.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'model/Album.php') diff --git a/model/Album.php b/model/Album.php index 5e93d05..9c90a6b 100644 --- a/model/Album.php +++ b/model/Album.php @@ -7,11 +7,13 @@ class Album extends Article public function __construct($page) { - $this->page = $page; - $this->fileCode = ''; // désigne un fichier json et un html + // pour: page, fileCode, time et makeFileList() + parent::__construct($page); + //$this->page = $page; + //$this->fileCode = ''; // désigne un fichier json et un html $this->format = 'json'; // vaut 'html' dans la classe mère - $this->time = time(); - $this->makeFileList(); + //$this->time = time(); + //$this->makeFileList(); } // GET @@ -58,10 +60,14 @@ class Album extends Article } // read + + // hydratation public function readAll() { // mettre le JSON dans fileList[$i]['content'] - parent::readAll(); + parent::readAll(); + // = surcharge, appeler la méthode de la classe mère + // permet de ne pas la remplacer par la nouvelle $this->format = 'html'; for($i = 0; $i < $this->fileListCount; $i++) @@ -92,6 +98,7 @@ class Album extends Article $this->format = 'json'; } + // hydratation public function readOne() { for($i = 0; $i < $this->fileListCount; $i++) -- cgit v1.2.3