summaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2022-02-24 02:29:14 +0100
committerpolo <ordipolo@gmx.fr>2022-02-24 02:29:14 +0100
commitf19db76cc3b21785619ffd24bfb34692a3aaa66a (patch)
tree7a715c3bc89232a981f3150caa46e61cba7850f2 /model
parent2c5dc14a9cd8bd847c724c0d43ddce8be0069013 (diff)
downloadmelaine-f19db76cc3b21785619ffd24bfb34692a3aaa66a.zip
recursiveIterator
Diffstat (limited to 'model')
-rw-r--r--model/Album.php17
1 files changed, 12 insertions, 5 deletions
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
7 7
8 public function __construct($page) 8 public function __construct($page)
9 { 9 {
10 $this->page = $page; 10 // pour: page, fileCode, time et makeFileList()
11 $this->fileCode = ''; // désigne un fichier json et un html 11 parent::__construct($page);
12 //$this->page = $page;
13 //$this->fileCode = ''; // désigne un fichier json et un html
12 $this->format = 'json'; // vaut 'html' dans la classe mère 14 $this->format = 'json'; // vaut 'html' dans la classe mère
13 $this->time = time(); 15 //$this->time = time();
14 $this->makeFileList(); 16 //$this->makeFileList();
15 } 17 }
16 18
17 // GET 19 // GET
@@ -58,10 +60,14 @@ class Album extends Article
58 } 60 }
59 61
60 // read 62 // read
63
64 // hydratation
61 public function readAll() 65 public function readAll()
62 { 66 {
63 // mettre le JSON dans fileList[$i]['content'] 67 // mettre le JSON dans fileList[$i]['content']
64 parent::readAll(); 68 parent::readAll();
69 // = surcharge, appeler la méthode de la classe mère
70 // permet de ne pas la remplacer par la nouvelle
65 71
66 $this->format = 'html'; 72 $this->format = 'html';
67 for($i = 0; $i < $this->fileListCount; $i++) 73 for($i = 0; $i < $this->fileListCount; $i++)
@@ -92,6 +98,7 @@ class Album extends Article
92 $this->format = 'json'; 98 $this->format = 'json';
93 } 99 }
94 100
101 // hydratation
95 public function readOne() 102 public function readOne()
96 { 103 {
97 for($i = 0; $i < $this->fileListCount; $i++) 104 for($i = 0; $i < $this->fileListCount; $i++)