Code Duplication    Length = 7-7 lines in 2 locations

src/api/object.php 2 locations

@@ 487-493 (lines=7) @@
484
            } catch (\Doctrine\ORM\NoResultException $e) {
485
                $up = 0;
486
            }
487
            if ($up === 0) {
488
                exception::not_exists();
489
                $this->id = 0;
490
                $this->set_guid('');
491
                return false;
492
            }
493
        }
494
495
        $qb = $this->get_uniquefield_query(get_class($this), $field, $name, $upfield, $up);
496
        $qb->select("c");
@@ 500-506 (lines=7) @@
497
498
        $entity = $qb->getQuery()->getOneOrNullResult();
499
500
        if ($entity === null) {
501
            exception::not_exists();
502
            $this->id = 0;
503
            $this->set_guid('');
504
            return false;
505
        }
506
        $this->populate_from_entity($entity);
507
508
        return true;
509
    }