public function actionGetNotifications()
 {
     $data = Yii::$app->request->post();
     $id = intval($data['id']);
     $replies = PostReplay::getAllUnreadRepliesByUserId($id);
     $arr = [];
     foreach ($replies as $row) {
         $temp['type'] = 'post';
         $temp['id'] = $row['id'];
         $temp['content'] = '<strong>' . User::getUserFirstNameById($row['replier']) . '</strong> has replied <strong>' . substr($row['title'], 0, 40) . '</strong>';
         $temp['datetime'] = $row['datetime'];
         $temp['modelId'] = $row['modelId'];
         $temp['timestamp'] = strtotime($row['datetime']);
         array_push($arr, $temp);
     }
     $announcement = AnnouncementHasParticipant::getUnreadAnnouncementByUserId($id);
     foreach ($announcement as $row) {
         $temp['type'] = 'announcement';
         $temp['id'] = $id;
         $temp['modelId'] = $row['id'];
         $temp['datetime'] = $row['datetime'];
         $temp['content'] = 'New announcement about <strong>' . substr($row['title'], 0, 40) . '</strong>';
         $temp['timestamp'] = strtotime($row['datetime']);
         array_push($arr, $temp);
     }
     $activity = ParticipantHasActivity::getTodayUnreadActivityByUserId($id);
     foreach ($activity as $row) {
         $temp['type'] = 'activity';
         $temp['id'] = $id;
         $temp['modelId'] = $row['id'];
         $temp['datetime'] = $row['datetime'];
         $temp['timestamp'] = strtotime($row['datetime']);
         $temp['content'] = 'Remember to attend <strong>' . $row['title'] . '</strong> at <strong>' . $row['venue'] . '</strong>';
         array_push($arr, $temp);
     }
     function cmp($a, $b)
     {
         if ($a['timestamp'] == $b['timestamp']) {
             return 0;
         }
         return $a['timestamp'] > $b['timestamp'] ? -1 : 1;
     }
     //usort($arr, "cmp");
     return json_encode($arr);
 }