<?php

namespace app\common\repositories\product;

use app\common\dao\product\ProductSeckillDao;
use app\common\repositories\BaseRepository;
use app\entity\data\product\ProductSeckillEntity;

class ProductSeckillRepository extends BaseRepository
{
    public function __construct(ProductSeckillDao $dao)
    {
        $this->dao = $dao;
    }

    /**
     * @param int $productId
     * @return ProductSeckillEntity
     */
    public function getProductSeckillEntityByProductId(int $productId): ProductSeckillEntity
    {
        /** @var ProductSeckillEntity $entity */
        $entity = $this->dao->getProductSeckillEntityByProductId($productId);
        return $entity;
    }
}