app/Plugin/SalesRestrictions42/Repository/ProductCustomerRankRepository.php line 21

Open in your IDE?
  1. <?php
  2. /*
  3. * Plugin Name : SalesRestrictions4
  4. *
  5. * Copyright (C) BraTech Co., Ltd. All Rights Reserved.
  6. * http://www.bratech.co.jp/
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11. namespace Plugin\SalesRestrictions42\Repository;
  12. use Eccube\Repository\AbstractRepository;
  13. use Doctrine\Persistence\ManagerRegistry as RegistryInterface;
  14. class ProductCustomerRankRepository extends AbstractRepository
  15. {
  16.     public function __construct(RegistryInterface $registry$entityClass \Plugin\SalesRestrictions42\Entity\ProductCustomerRank::class)
  17.     {
  18.         parent::__construct($registry$entityClass);
  19.     }
  20.     public function getRankIdsforProduct($product)
  21.     {
  22.         $results $this->findBy(['Product' => $product]);
  23.         $Ids = [];
  24.         foreach($results as $result){
  25.             $Ids[] = $result->getCustomerRankId();
  26.         }
  27.         return $Ids;
  28.     }
  29. }