public function getDocumentManager($dmName = null)
{
$dmName = $dmName ?: $this->defaultDocumentManager;
// Check if ORM Entity Manager has not yet been initialized
if (!isset($this->documentManagers[$dmName])) {
// Check if ORM EntityManager is configured
if (!isset($this->configuration['odm'][$dmName])) {
throw new \Core\Application\Exception\NameNotFoundException("Unable to find Doctrine ODM DocumentManager '{$dmName}'.");
}
$this->documentManagers[$dmName] = $this->startODMDocumentManager($this->configuration['odm'][$dmName]);
unset($this->configuration['odm'][$dmName]);
}
return $this->documentManagers[$dmName];
}