public function up()
 {
     $this->renameClass('DropboxPost', DropboxPost::className());
     $this->update('dropbox_file', ['object_model' => DropboxPost::className()]);
     foreach (\humhub\modules\activity\models\Activity::findAll(['module' => 'dropbox']) as $activity) {
         $activity->delete();
     }
 }
 public function up()
 {
     $this->renameClass('Note', Note::className());
     $this->delete('notification', ['class' => 'NoteCreatedNotification']);
     $this->delete('notification', ['class' => 'NoteUpdatedNotification']);
     foreach (\humhub\modules\activity\models\Activity::findAll(['module' => 'notes']) as $activity) {
         $activity->delete();
     }
 }
Ejemplo n.º 3
0
 public function beforeDelete()
 {
     // ToDo: Handle this via event of User Module
     if ($this->object_model == User::className()) {
         $notification = new \humhub\modules\user\notifications\Followed();
         $notification->originator = $this->user;
         $notification->delete($this->getTarget());
         foreach (Activity::findAll(['object_model' => $this->className(), 'object_id' => $this->id]) as $activity) {
             $activity->delete();
         }
     }
     return parent::beforeDelete();
 }