/**
  * delete all from evennts and deals
  */
 public function actionDelEventsAndDeals()
 {
     CalendarEvents::deleteAll();
     ContractDeals::deleteAll();
     return 'alles werwijderd';
 }
 /**
  * Vervewijder alle werknemers die gelieerd zijn aan een company
  * 
  **/
 public function deleteDependentUsers($user)
 {
     $depUsers = Yii::$app->getModule("user")->model("User");
     $depUsers = User::findAll(['company_id' => $user->company_id]);
     if ($depUsers) {
         foreach ($depUsers as $depUser) {
             //$reistarief = UserReistarief::findAll(['user_id'=>$depUser->id]);
             UserReistarief::deleteAll(['user_id' => $depUser->id]);
             //$tarief = UserTarieven::findAll(['user_id'=>$depUser->id]);
             UserTarieven::deleteAll(['user_id' => $depUser->id]);
             //$cv = UserCv::findAll(['user_id'=>$depUser->id]);
             UserCv::deleteAll(['user_id' => $depUser->id]);
             //$ce = CalendarEvents::find()->where(['user_id'=>$depUser->id])->all;
             CalendarEvents::deleteAll(['user_id' => $depUser->id]);
             //$cd = ContractDeals::find()->where(['user_id'=>$depUser->id])->all;
             ContractDeals::deleteAll(['user_id' => $depUser->id]);
             Profile::deleteAll(['user_id' => $depUser->id]);
         }
     }
 }