| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class ScoreInvestigationHandler |
||
| 13 | { |
||
| 14 | protected EntityManagerInterface $em; |
||
| 15 | |||
| 16 | public function __construct(EntityManagerInterface $em) |
||
| 17 | { |
||
| 18 | $this->em = $em; |
||
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @throws ORMException |
||
| 23 | */ |
||
| 24 | public function handle(): void |
||
| 25 | { |
||
| 26 | $list = $this->getScoreToDesactivate(); |
||
| 27 | $statut = $this->em->getReference( |
||
| 28 | 'VideoGamesRecords\CoreBundle\Entity\PlayerChartStatus', |
||
| 29 | PlayerChartStatus::ID_STATUS_NOT_PROOVED |
||
| 30 | ); |
||
| 31 | /** @var PlayerChart $playerChart */ |
||
| 32 | foreach ($list as $playerChart) { |
||
| 33 | $playerChart->setStatus($statut); |
||
| 34 | } |
||
| 35 | $this->em->flush(); |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @return array |
||
| 40 | */ |
||
| 41 | private function getScoreToDesactivate(): array |
||
| 55 | } |
||
| 56 | } |
||
| 57 |