/**
  * Deletes an agent application and accociated Contact/Email records 
  * return id of record of record deleted
  */
 public function cascadeDeleteByUid($uid)
 {
     $select = $this->select()->from($this->_name, array('id'))->where('uid = ?', $uid);
     $row = $this->fetchRow($select);
     if ($row) {
         // Delete associated Contacts
         $contacts = new LettingAgents_Datasource_Contacts();
         $contacts->deleteById($row['id']);
         $this->deleteById($row['id']);
         // Delete associated Emails
         $emails = new LettingAgents_Datasource_Email();
         $emails->deleteById($row['id']);
     }
     return false;
 }
Esempio n. 2
0
 /**
  * Remove a contact by its uid
  */
 public function deleteByUid($uid)
 {
     $contacts = new LettingAgents_Datasource_Contacts();
     return $contacts->deleteByUid($uid);
 }