Code Duplication    Length = 10-11 lines in 3 locations

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/RaListingRepository.php 3 locations

@@ 217-226 (lines=10) @@
214
     * @param IdentityId $identityId
215
     * @return void
216
     */
217
    public function removeByIdentityId(IdentityId $identityId)
218
    {
219
        $this->getEntityManager()->createQueryBuilder()
220
            ->delete($this->_entityName, 'ral')
221
            ->where('ral.identityId = :identityId')
222
            ->andWhere('ral.raInstitution = :institution')
223
            ->setParameter('identityId', $identityId->getIdentityId())
224
            ->getQuery()
225
            ->execute();
226
    }
227
228
    /**
229
     * @param IdentityId $identityId
@@ 233-243 (lines=11) @@
230
     * @param Institution $raInstitution
231
     * @return void
232
     */
233
    public function removeByIdentityIdAndRaInstitution(IdentityId $identityId, Institution $raInstitution)
234
    {
235
        $this->getEntityManager()->createQueryBuilder()
236
            ->delete($this->_entityName, 'ral')
237
            ->where('ral.identityId = :identityId')
238
            ->andWhere('ral.raInstitution = :institution')
239
            ->setParameter('identityId', $identityId->getIdentityId())
240
            ->setParameter('institution', $raInstitution)
241
            ->getQuery()
242
            ->execute();
243
    }
244
245
    /**
246
     * @param IdentityId $identityId
@@ 250-260 (lines=11) @@
247
     * @param Institution $institution
248
     * @return void
249
     */
250
    public function removeByIdentityIdAndInstitution(IdentityId $identityId, Institution $institution)
251
    {
252
        $this->getEntityManager()->createQueryBuilder()
253
            ->delete($this->_entityName, 'ral')
254
            ->where('ral.identityId = :identityId')
255
            ->andWhere('ral.institution = :institution')
256
            ->setParameter('identityId', $identityId->getIdentityId())
257
            ->setParameter('institution', $institution)
258
            ->getQuery()
259
            ->execute();
260
    }
261
262
    /**
263
     * Select the explicitly appointed institutions by identity id and role