| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | public function setName(string $name): void |
||
| 26 | { |
||
| 27 | /** @var InstitutionRepository $institutionRepository */ |
||
| 28 | $institutionRepository = _em()->getRepository(self::class); |
||
| 29 | |||
| 30 | $exists = $institutionRepository->findOneBy(['name' => $name]); |
||
| 31 | if ($exists && $exists->getId() !== $this->getId()) { |
||
| 32 | throw new Exception('Le nom de cette institution existe déjà.'); |
||
| 33 | } |
||
| 34 | parent::setName($name); |
||
| 35 | } |
||
| 37 |