protected function _getEntityManager(Configuration $config = null)
{
if (null !== $this->_em) {
return $this->_em;
}
$connection = $this->_getConnection();
if (!$config) {
$config = $connection->getConfiguration();
}
$this->_setupConfiguration($config);
$em = EntityManager::create($connection, $config);
return $this->_em = $em;
}