Code Duplication    Length = 7-7 lines in 2 locations

src/api/object.php 2 locations

@@ 475-481 (lines=7) @@
472
            } catch (\Doctrine\ORM\NoResultException $e) {
473
                $up = 0;
474
            }
475
            if ($up === 0) {
476
                exception::not_exists();
477
                $this->id = 0;
478
                $this->set_guid('');
479
                return false;
480
            }
481
        }
482
483
        $qb = $this->get_uniquefield_query(get_class($this), $field, $name, $upfield, $up);
484
        $qb->select("c");
@@ 488-494 (lines=7) @@
485
486
        $entity = $qb->getQuery()->getOneOrNullResult();
487
488
        if ($entity === null) {
489
            exception::not_exists();
490
            $this->id = 0;
491
            $this->set_guid('');
492
            return false;
493
        }
494
        $this->populate_from_entity($entity);
495
496
        return true;
497
    }