src/Services/Product.php line 41

Open in your IDE?
  1. <?php
  2. namespace App\Services;
  3. use App\Repository\ProductRepository;
  4. class Product
  5. {
  6.     public function getProductAll()
  7.     {
  8.         return $this->productRepository->findAll();
  9.     }
  10.     public function getProductMainAll()
  11.     {
  12.         return $this->productRepository->findBy([
  13.             'category'=>'Main'
  14.         ]);
  15.     }
  16.     public function getProductSubAll()
  17.     {
  18.         return $this->productRepository->findBy([
  19.             'category'=>'Sub'
  20.         ]);
  21.     }
  22.     public function getProductActive()
  23.     {
  24.         return $this->productRepository->findBy([
  25.             'isActive'=>'1'
  26.         ]);
  27.     }
  28.     public function getProductFooter()
  29.     {
  30.         return $this->productRepository->findBy([
  31.             'includeInFooter'=>'1'
  32.         ]);
  33.     }
  34.     public function __construct(ProductRepository $productRepository)
  35.     {
  36.         $this->productRepository $productRepository;
  37.     }
  38. }