Code Duplication    Length = 7-7 lines in 3 locations

src/Kunstmaan/DashboardBundle/Repository/AnalyticsConfigRepository.php 3 locations

@@ 170-176 (lines=7) @@
167
     *
168
     * @throws \Doctrine\ORM\OptimisticLockException
169
     */
170
    public function saveProfileId($profileId, $id = false)
171
    {
172
        $em = $this->getEntityManager();
173
        $config = $id ? $this->find($id) : $this->findFirst();
174
        $config->setProfileId($profileId);
175
        $em->persist($config);
176
        $em->flush();
177
    }
178
179
    /**
@@ 185-191 (lines=7) @@
182
     *
183
     * @throws \Doctrine\ORM\OptimisticLockException
184
     */
185
    public function saveConfigName($name, $id = false)
186
    {
187
        $em = $this->getEntityManager();
188
        $config = $id ? $this->find($id) : $this->findFirst();
189
        $config->setName($name);
190
        $em->persist($config);
191
        $em->flush();
192
    }
193
194
    /**
@@ 199-205 (lines=7) @@
196
     *
197
     * @throws \Doctrine\ORM\OptimisticLockException
198
     */
199
    public function resetProfileId($id = false)
200
    {
201
        $em = $this->getEntityManager();
202
        $config = $id ? $this->find($id) : $this->findFirst();
203
        $config->setProfileId('');
204
        $em->persist($config);
205
        $em->flush();
206
    }
207
208
    /**