src/Service/QcmService.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Service;
  3. use App\Repository\QcmRepository;
  4. use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
  5. /**
  6.  * Class QcmService
  7.  * @package App\Service
  8.  */
  9. class QcmService extends BaseService
  10. {
  11.     /**
  12.      * QcmRepository constructor.
  13.      * @param QcmRepository $repository
  14.      */
  15.     public function __construct(
  16.         QcmRepository $repository,
  17.         BaseService $baseService,
  18.         UrlGeneratorInterface $urlGenerator
  19.     ) {
  20.         $this->reflectFromParent($baseService);
  21.         $this->repository $repository;
  22.         $this->urlGenerator $urlGenerator;
  23.     }
  24.     public function getById($id)
  25.     {
  26.         return $this->repository->getOneBy(
  27.             [
  28.                 'filter_id' => $id
  29.             ]
  30.         );
  31.     }
  32. }