| @@ 522-528 (lines=7) @@ | ||
| 519 | $qb = $this->get_uniquefield_query($parentclass, $field, $part, $parentfield, $up); |
|
| 520 | $qb->select("c.id"); |
|
| 521 | $up = intval($qb->getQuery()->getOneOrNullResult(Query::HYDRATE_SINGLE_SCALAR)); |
|
| 522 | if ($up === 0) |
|
| 523 | { |
|
| 524 | exception::not_exists(); |
|
| 525 | $this->id = 0; |
|
| 526 | $this->set_guid(''); |
|
| 527 | return false; |
|
| 528 | } |
|
| 529 | } |
|
| 530 | ||
| 531 | $qb = $this->get_uniquefield_query(get_class($this), $field, $name, $upfield, $up); |
|
| @@ 536-542 (lines=7) @@ | ||
| 533 | ||
| 534 | $entity = $qb->getQuery()->getOneOrNullResult(); |
|
| 535 | ||
| 536 | if ($entity === null) |
|
| 537 | { |
|
| 538 | exception::not_exists(); |
|
| 539 | $this->id = 0; |
|
| 540 | $this->set_guid(''); |
|
| 541 | return false; |
|
| 542 | } |
|
| 543 | $this->populate_from_entity($entity); |
|
| 544 | ||
| 545 | return true; |
|