diff options
Diffstat (limited to 'src/model/Model.php')
| -rw-r--r-- | src/model/Model.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/model/Model.php b/src/model/Model.php index b650183..de391ff 100644 --- a/src/model/Model.php +++ b/src/model/Model.php | |||
| @@ -58,11 +58,16 @@ class Model | |||
| 58 | ->setParameter('page', $this->page) | 58 | ->setParameter('page', $this->page) |
| 59 | ->getResult(); | 59 | ->getResult(); |
| 60 | 60 | ||
| 61 | // groupes d'articles triés par bloc, permet de paginer par bloc | ||
| 62 | foreach($bulk_data as $parent_block){ | 61 | foreach($bulk_data as $parent_block){ |
| 62 | // groupes d'articles triés par bloc, permet de paginer par bloc | ||
| 63 | if(Blocks::hasPresentation($parent_block->getName())){ // = post_block ou news_block | 63 | if(Blocks::hasPresentation($parent_block->getName())){ // = post_block ou news_block |
| 64 | $bulk_data = array_merge($bulk_data, $this->getNextArticles($parent_block, $request)[0]); | 64 | $bulk_data = array_merge($bulk_data, $this->getNextArticles($parent_block, $request)[0]); |
| 65 | } | 65 | } |
| 66 | |||
| 67 | // emails | ||
| 68 | if($parent_block->getName() === 'show_emails'){ | ||
| 69 | $parent_block->getNodeData()->setEmails($this->getAllEmails()); | ||
| 70 | } | ||
| 66 | } | 71 | } |
| 67 | } | 72 | } |
| 68 | else{ // page "article" | 73 | else{ // page "article" |
| @@ -283,4 +288,14 @@ class Model | |||
| 283 | $this->node->addChild($child); | 288 | $this->node->addChild($child); |
| 284 | } | 289 | } |
| 285 | } | 290 | } |
| 291 | |||
| 292 | private function getAllEmails(): array | ||
| 293 | { | ||
| 294 | $dql = 'SELECT e FROM App\Entity\Email e'; | ||
| 295 | return $this->entityManager | ||
| 296 | ->createQuery($dql) | ||
| 297 | //->setParameter('page', $this->page) | ||
| 298 | ->getResult(); | ||
| 299 | } | ||
| 300 | //private function getEmails(string $sender): array | ||
| 286 | } | 301 | } |
