Code Duplication    Length = 5-8 lines in 2 locations

src/api/user.php 1 location

@@ 223-227 (lines=5) @@
220
            'authtype' => $this->authtype
221
        );
222
223
        if ($this->id)
224
        {
225
            $parameters['id'] = $this->id;
226
            $conditions->add($qb->expr()->neq('c.id', ':id'));
227
        }
228
        $conditions->add($qb->expr()->eq('c.login', ':login'));
229
        $conditions->add($qb->expr()->eq('c.authtype', ':authtype'));
230

src/api/object.php 1 location

@@ 303-310 (lines=8) @@
300
        $qb = connection::get_em()->createQueryBuilder();
301
        $qb->from(get_class($this), 'c');
302
        $conditions = $qb->expr()->andX();
303
        if ($this->id)
304
        {
305
            $parameters = array
306
            (
307
                'id' => $this->id
308
            );
309
            $conditions->add($qb->expr()->neq('c.id', ':id'));
310
        }
311
        $found = false;
312
        foreach ($this->cm->midgard['unique_fields'] as $field)
313
        {