<?php
/*
* Plugin Name : SalesRestrictions4
*
* Copyright (C) BraTech Co., Ltd. All Rights Reserved.
* http://www.bratech.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Plugin\SalesRestrictions42\Repository;
use Eccube\Repository\AbstractRepository;
use Doctrine\Persistence\ManagerRegistry as RegistryInterface;
class ProductCustomerRankRepository extends AbstractRepository
{
public function __construct(RegistryInterface $registry, $entityClass = \Plugin\SalesRestrictions42\Entity\ProductCustomerRank::class)
{
parent::__construct($registry, $entityClass);
}
public function getRankIdsforProduct($product)
{
$results = $this->findBy(['Product' => $product]);
$Ids = [];
foreach($results as $result){
$Ids[] = $result->getCustomerRankId();
}
return $Ids;
}
}