3 роки тому
123456789101112131415161718192021222324252627282930313233
  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. }