Exemplo n.º 1
0
 /**
  * get instance
  *
  *
  * @return Contact_Model_ContactMapper
  */
 public static function getInstance()
 {
     if (self::$_instance === null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Exemplo n.º 2
0
 public function contactDeleteAction()
 {
     $id = $this->_getParam('contact_id');
     $contact = new Contact_Model_Contact();
     if (!Contact_Model_ContactMapper::getInstance()->find($id, $contact)) {
         return $this->_formHelper->returnError($this->translate('Contact not found.'));
     }
     Contact_Model_ContactMapper::getInstance()->delete($contact);
     return $this->_formHelper->returnSuccess($this->view->url(array('action' => 'contact-list')), $this->translate('Contact deleted.'));
 }