|
@@ 69-71 (lines=3) @@
|
| 66 |
|
|
| 67 |
|
/** @var EntityMetadata $metadata */ |
| 68 |
|
$metadata = $this->getClassMetadata($className); |
| 69 |
|
if (false !== ($entity = $this->getUnitOfWork()->tryGetById($id, $metadata->rootEntityName))) { |
| 70 |
|
return $entity instanceof $metadata->name ? $entity : null; |
| 71 |
|
} |
| 72 |
|
|
| 73 |
|
return $this->getUnitOfWork()->getEntityPersister($className)->loadById($id); |
| 74 |
|
} |
|
@@ 203-205 (lines=3) @@
|
| 200 |
|
|
| 201 |
|
/** @var EntityMetadata $metadata */ |
| 202 |
|
$metadata = $this->getClassMetadata($entityName); |
| 203 |
|
if (false !== ($entity = $this->getUnitOfWork()->tryGetById($id, $metadata->rootEntityName))) { |
| 204 |
|
return $entity instanceof $metadata->name ? $entity : null; |
| 205 |
|
} |
| 206 |
|
|
| 207 |
|
$proxy = $this->getProxyFactory()->getProxy($entityName, $id); |
| 208 |
|
$this->getUnitOfWork()->registerManaged($proxy, $id, null); |