Ejemplo n.º 1
0
 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();
 }