app/Plugin/MultiCategorySearch42/Repository/ConfigRepository.php line 22

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of MultiCategorySearch
  4.  *
  5.  * Copyright(c) Akira Kurozumi <info@a-zumi.net>
  6.  *
  7.  * https://a-zumi.net
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Plugin\MultiCategorySearch42\Repository;
  13. use Doctrine\Persistence\ManagerRegistry;
  14. use Eccube\Repository\AbstractRepository;
  15. use Plugin\MultiCategorySearch42\Entity\Config;
  16. class ConfigRepository extends AbstractRepository
  17. {
  18.     public function __construct(ManagerRegistry $registry)
  19.     {
  20.         parent::__construct($registryConfig::class);
  21.     }
  22.     /**
  23.      * @param int $id
  24.      *
  25.      * @return Config
  26.      *
  27.      * @throws \Exception
  28.      */
  29.     public function get(int $id 1): Config
  30.     {
  31.         $config $this->find($id);
  32.         if (null === $config) {
  33.             throw new \Exception('Config not found. id = '.$id);
  34.         }
  35.         return $config;
  36.     }
  37. }