Code Duplication    Length = 10-11 lines in 3 locations

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

@@ 154-163 (lines=10) @@
151
     * @param IdentityId $identityId
152
     * @return void
153
     */
154
    public function removeByIdentityId(IdentityId $identityId)
155
    {
156
        $this->getEntityManager()->createQueryBuilder()
157
            ->delete($this->_entityName, 'ral')
158
            ->where('ral.identityId = :identityId')
159
            ->andWhere('ral.raInstitution = :institution')
160
            ->setParameter('identityId', $identityId->getIdentityId())
161
            ->getQuery()
162
            ->execute();
163
    }
164
165
    /**
166
     * @param IdentityId $identityId
@@ 170-180 (lines=11) @@
167
     * @param Institution $raInstitution
168
     * @return void
169
     */
170
    public function removeByIdentityIdAndRaInstitution(IdentityId $identityId, Institution $raInstitution)
171
    {
172
        $this->getEntityManager()->createQueryBuilder()
173
            ->delete($this->_entityName, 'ral')
174
            ->where('ral.identityId = :identityId')
175
            ->andWhere('ral.raInstitution = :institution')
176
            ->setParameter('identityId', $identityId->getIdentityId())
177
            ->setParameter('institution', $raInstitution)
178
            ->getQuery()
179
            ->execute();
180
    }
181
182
    /**
183
     * @param IdentityId $identityId
@@ 187-197 (lines=11) @@
184
     * @param Institution $institution
185
     * @return void
186
     */
187
    public function removeByIdentityIdAndInstitution(IdentityId $identityId, Institution $institution)
188
    {
189
        $this->getEntityManager()->createQueryBuilder()
190
            ->delete($this->_entityName, 'ral')
191
            ->where('ral.identityId = :identityId')
192
            ->andWhere('ral.institution = :institution')
193
            ->setParameter('identityId', $identityId->getIdentityId())
194
            ->setParameter('institution', $institution)
195
            ->getQuery()
196
            ->execute();
197
    }
198
}
199