@@ 70-82 (lines=13) @@ | ||
67 | * @param IdentityId $identityId |
|
68 | * @return void |
|
69 | */ |
|
70 | public function removeByIdentityId(IdentityId $identityId) |
|
71 | { |
|
72 | $raCandidates = $this->findByIdentityId($identityId); |
|
73 | ||
74 | if (count($raCandidates) < 1) { |
|
75 | return; |
|
76 | } |
|
77 | ||
78 | foreach ($raCandidates as $candidate) { |
|
79 | $this->getEntityManager()->remove($candidate); |
|
80 | } |
|
81 | $this->getEntityManager()->flush(); |
|
82 | } |
|
83 | ||
84 | ||
85 | /** |
|
@@ 89-101 (lines=13) @@ | ||
86 | * @param IdentityId $identityId |
|
87 | * @return void |
|
88 | */ |
|
89 | public function removeIfSingleByIdentityId(IdentityId $identityId) |
|
90 | { |
|
91 | $raCandidates = $this->findByIdentityId($identityId); |
|
92 | ||
93 | if (count($raCandidates) != 1) { |
|
94 | return; |
|
95 | } |
|
96 | ||
97 | foreach ($raCandidates as $candidate) { |
|
98 | $this->getEntityManager()->remove($candidate); |
|
99 | } |
|
100 | $this->getEntityManager()->flush(); |
|
101 | } |
|
102 | ||
103 | /** |
|
104 | * @param Institution $institution |