@@ 57-59 (lines=3) @@ | ||
54 | $id = IdentifierFixer::fixScalarId($id, $metadata); |
|
55 | ||
56 | /** @var EntityMetadata $metadata */ |
|
57 | if (false !== ($entity = $this->getUnitOfWork()->tryGetById($id, $metadata->rootEntityName))) { |
|
58 | return $entity instanceof $metadata->name ? $entity : null; |
|
59 | } |
|
60 | ||
61 | return $this->getUnitOfWork()->getEntityPersister($className)->loadById($id); |
|
62 | } |
|
@@ 177-179 (lines=3) @@ | ||
174 | $metadata = $this->getClassMetadata($entityName); |
|
175 | $id = IdentifierFixer::fixScalarId($id, $metadata); |
|
176 | ||
177 | if (false !== ($entity = $this->getUnitOfWork()->tryGetById($id, $metadata->rootEntityName))) { |
|
178 | return $entity instanceof $metadata->name ? $entity : null; |
|
179 | } |
|
180 | ||
181 | $proxy = $this->getProxyFactory()->getProxy($entityName, $id); |
|
182 | $this->getUnitOfWork()->registerManaged($proxy, $id, null); |