Code Duplication    Length = 9-9 lines in 8 locations

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

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

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

@@ 116-124 (lines=9) @@
113
                ->getSingleResult();
114
    }
115
116
    public function removeByIdentityId(IdentityId $identityId)
117
    {
118
        $this->getEntityManager()->createQueryBuilder()
119
            ->delete($this->_entityName, 'i')
120
            ->where('i.id = :identityId')
121
            ->setParameter('identityId', $identityId->getIdentityId())
122
            ->getQuery()
123
            ->execute();
124
    }
125
}
126

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/RaSecondFactorRepository.php 1 location

@@ 130-138 (lines=9) @@
127
     * @param IdentityId $identityId
128
     * @return void
129
     */
130
    public function removeByIdentityId(IdentityId $identityId)
131
    {
132
        $this->getEntityManager()->createQueryBuilder()
133
            ->delete($this->_entityName, 'rasf')
134
            ->where('rasf.identityId = :identityId')
135
            ->setParameter('identityId', $identityId->getIdentityId())
136
            ->getQuery()
137
            ->execute();
138
    }
139
140
    public function save(RaSecondFactor $secondFactor)
141
    {

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/VerifiedSecondFactorRepository.php 1 location

@@ 70-78 (lines=9) @@
67
        return $queryBuilder->getQuery();
68
    }
69
70
    public function removeByIdentityId(IdentityId $identityId)
71
    {
72
        $this->getEntityManager()->createQueryBuilder()
73
            ->delete($this->_entityName, 'sf')
74
            ->where('sf.identityId = :identityId')
75
            ->setParameter('identityId', $identityId->getIdentityId())
76
            ->getQuery()
77
            ->execute();
78
    }
79
80
    /**
81
     * @param VerifiedSecondFactor $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