Total Complexity | 6 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class RpgPlotMemberArchivRepository extends EntityRepository implements RpgPlotMemberArchivRepositoryInterface |
||
15 | { |
||
16 | public function getByPlotAndUser(int $plotId, int $userId): ?RpgPlotMemberArchivInterface |
||
17 | { |
||
18 | return $this->findOneBy([ |
||
19 | 'plot_id' => $plotId, |
||
20 | 'user_id' => $userId |
||
21 | ]); |
||
22 | } |
||
23 | |||
24 | public function prototype(): RpgPlotMemberArchivInterface |
||
25 | { |
||
26 | return new RpgPlotMemberArchivInterface(); |
||
27 | } |
||
28 | |||
29 | public function save(RpgPlotMemberArchivInterface $rpgPlotMember): void |
||
30 | { |
||
31 | $em = $this->getEntityManager(); |
||
32 | |||
33 | $em->persist($rpgPlotMember); |
||
34 | } |
||
35 | |||
36 | public function delete(RpgPlotMemberArchivInterface $rpgPlotMember): void |
||
37 | { |
||
38 | $em = $this->getEntityManager(); |
||
39 | |||
40 | $em->remove($rpgPlotMember); |
||
41 | } |
||
42 | |||
43 | public function getByPlot(int $plotId): array |
||
44 | { |
||
45 | return $this->findBy([ |
||
46 | 'plot_id' => $plotId |
||
47 | ]); |
||
48 | } |
||
49 | |||
50 | public function truncateAllEntities(): void |
||
58 | } |
||
59 | } |
||
60 |