You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
790B

  1. <?php
  2. namespace Lc\CaracoleBundle\Solver\Merchant;
  3. use Lc\CaracoleBundle\Model\Merchant\MerchantInterface;
  4. class MerchantSolver
  5. {
  6. public function getNewsletters(MerchantInterface $merchant): array
  7. {
  8. $newsletterArray = [];
  9. foreach($merchant->getSections() as $section) {
  10. foreach($section->getNewsletters() as $newsletter) {
  11. $newsletterArray[] = $newsletter;
  12. }
  13. }
  14. return $newsletterArray;
  15. }
  16. public function getSectionsOnline(MerchantInterface $merchant):array{
  17. $sectionArray = [];
  18. foreach($merchant->getSections() as $section) {
  19. if($section->getStatus() == 1){
  20. $sectionArray[] = $section;
  21. }
  22. }
  23. return $sectionArray;
  24. }
  25. }