public function getEntityManager()
    {
        if (!isset($this->_entityManager)) {
            $this->_entityManager = $this->getServiceLocator()
                    ->get('Doctrine\ORM\EntityManager');
        }
        return $this->_entityManager;
    }