Eccube\Repository\ProductRepository::get PHP Method

get() public method

get Product.
public get ( integer $productId ) : Product
$productId integer
return Eccube\Entity\Product
    public function get($productId)
    {
        // Product
        try {
            $qb = $this->createQueryBuilder('p')->andWhere('p.id = :id');
            $product = $qb->getQuery()->setParameters(array('id' => $productId))->getSingleResult();
        } catch (NoResultException $e) {
            throw new NotFoundHttpException();
        }
        return $product;
    }