public function delete() { // borramos el usuario y mandamos el mail $this->get('usuario')->delete(); $this->enviar_mail_perfil_borrado(); // borramos este objeto return parent::delete(); }
public function delete() { // cuando borramos un mensaje, lo que hacemos es borrar todas las notificaciones relacionadas con ese mensaje. $id = $this->id(); $filtro[] = array('value' => $id, 'field' => 'origen(perfil_mensaje)', 'type' => 'list'); if ($notificaciones = perfil_notificacion::getFilteredList(0, 0, false, false, $filtro)) { foreach ($notificaciones as $notificacion) { $notificacion->delete(); } } return parent::delete(); }