public function getObjectByIdentifier($identifier, $objectType = null, $useLazyLoading = false)
{
if ($objectType === null) {
throw new \RuntimeException('Using only the identifier is not supported by Doctrine 2. Give classname as well or use repository to query identifier.', 1296646103);
}
if (isset($this->newObjects[$identifier])) {
return $this->newObjects[$identifier];
}
if ($useLazyLoading === true) {
return $this->entityManager->getReference($objectType, $identifier);
} else {
return $this->entityManager->find($objectType, $identifier);
}
}