private function saveEntity() { $em = \Zend_Registry::get('container')->getService('em'); if ($em->contains($this)) { $em->flush($this); } }