Code Duplication    Length = 9-9 lines in 8 locations

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/RaListingRepository.php 1 location

@@ 122-130 (lines=9) @@
119
     * @param IdentityId $identityId
120
     * @return void
121
     */
122
    public function removeByIdentityId(IdentityId $identityId)
123
    {
124
        $this->getEntityManager()->createQueryBuilder()
125
            ->delete($this->_entityName, 'ral')
126
            ->where('ral.identityId = :identityId')
127
            ->setParameter('identityId', $identityId->getIdentityId())
128
            ->getQuery()
129
            ->execute();
130
    }
131
132
    /**
133
     * @param RaListing $raListing

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/UnverifiedSecondFactorRepository.php 1 location

@@ 63-71 (lines=9) @@
60
        return $queryBuilder->getQuery();
61
    }
62
63
    public function removeByIdentityId(IdentityId $identityId)
64
    {
65
        $this->getEntityManager()->createQueryBuilder()
66
            ->delete($this->_entityName, 'sf')
67
            ->where('sf.identityId = :identityId')
68
            ->setParameter('identityId', $identityId->getIdentityId())
69
            ->getQuery()
70
            ->execute();
71
    }
72
73
    /**
74
     * @param UnverifiedSecondFactor $secondFactor

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/VettedSecondFactorRepository.php 1 location

@@ 58-66 (lines=9) @@
55
        return $queryBuilder->getQuery();
56
    }
57
58
    public function removeByIdentityId(IdentityId $identityId)
59
    {
60
        $this->getEntityManager()->createQueryBuilder()
61
            ->delete($this->_entityName, 'sf')
62
            ->where('sf.identityId = :identityId')
63
            ->setParameter('identityId', $identityId->getIdentityId())
64
            ->getQuery()
65
            ->execute();
66
    }
67
68
    /**
69
     * @param VettedSecondFactor $secondFactor

src/Surfnet/StepupMiddleware/GatewayBundle/Repository/SecondFactorRepository.php 1 location

@@ 55-63 (lines=9) @@
52
        return $this->findBy(['identityId' => (string) $identityId]);
53
    }
54
55
    public function removeByIdentityId(IdentityId $identityId)
56
    {
57
        $this->getEntityManager()->createQueryBuilder()
58
            ->delete($this->_entityName, 'sf')
59
            ->where('sf.identityId = :identityId')
60
            ->setParameter('identityId', $identityId->getIdentityId())
61
            ->getQuery()
62
            ->execute();
63
    }
64
65
    /**
66
     * @param SecondFactor $secondFactor

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/AuditLogRepository.php 1 location

@@ 110-118 (lines=9) @@
107
     * @param IdentityId $identityId
108
     * @return void
109
     */
110
    public function removeByIdentityId(IdentityId $identityId)
111
    {
112
        $this->getEntityManager()->createQueryBuilder()
113
            ->delete($this->_entityName, 'al')
114
            ->where('al.identityId = :identityId')
115
            ->setParameter('identityId', $identityId->getIdentityId())
116
            ->getQuery()
117
            ->execute();
118
    }
119
120
    /**
121
     * @param AuditLogEntry $entry

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/IdentityRepository.php 1 location

@@ 153-161 (lines=9) @@
150
                ->getSingleResult();
151
    }
152
153
    public function removeByIdentityId(IdentityId $identityId)
154
    {
155
        $this->getEntityManager()->createQueryBuilder()
156
            ->delete($this->_entityName, 'i')
157
            ->where('i.id = :identityId')
158
            ->setParameter('identityId', $identityId->getIdentityId())
159
            ->getQuery()
160
            ->execute();
161
    }
162
}
163

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/VerifiedSecondFactorRepository.php 1 location

@@ 122-130 (lines=9) @@
119
        return $queryBuilder->getQuery();
120
    }
121
122
    public function removeByIdentityId(IdentityId $identityId)
123
    {
124
        $this->getEntityManager()->createQueryBuilder()
125
            ->delete($this->_entityName, 'sf')
126
            ->where('sf.identityId = :identityId')
127
            ->setParameter('identityId', $identityId->getIdentityId())
128
            ->getQuery()
129
            ->execute();
130
    }
131
132
    /**
133
     * @param VerifiedSecondFactor $secondFactor

src/Surfnet/StepupMiddleware/ApiBundle/Identity/Repository/RaSecondFactorRepository.php 1 location

@@ 155-163 (lines=9) @@
152
     * @param IdentityId $identityId
153
     * @return void
154
     */
155
    public function removeByIdentityId(IdentityId $identityId)
156
    {
157
        $this->getEntityManager()->createQueryBuilder()
158
            ->delete($this->_entityName, 'rasf')
159
            ->where('rasf.identityId = :identityId')
160
            ->setParameter('identityId', $identityId->getIdentityId())
161
            ->getQuery()
162
            ->execute();
163
    }
164
165
    public function save(RaSecondFactor $secondFactor)
166
    {