/**
  * answering on request, accept or dismiss
  *
  * @param type $req_id
  * @param type $answer answer on request true or false.
  */
 public static function answerRequest($req_id, $answer)
 {
     $user1_id = RequestService::getUser1Id($req_id);
     $user2_id = RequestService::getUser2Id($req_id);
     $uid1 = new UserId($user1_id);
     $uid2 = new UserId($user2_id);
     ///AccessService
     try {
         if (!AccessService::hasAccess($user2_id, ObjectCheckType::Request)) {
             \Yii::$app->session->setFlash('error', 'Access Denied');
             return false;
         }
     } catch (Exception $ex) {
         Yii::$app->session->setFlash('warning', 'Something went wrong, contact Administrator');
         return false;
     }
     ///end AccessService
     if ($answer) {
         RelationService::setRelation($uid1, $uid2, RelationType::Friend);
         RelationService::setRelation($uid1, $uid2, RelationType::Follower);
         // for default friend is followed
         RelationService::setRelation($uid2, $uid1, RelationType::Follower);
         EventService::createEvent(EEvent::FRIEND_REQUEST_ACCEPTED(), $uid2, true, $uid1);
         EventService::createEvent(EEvent::FRIEND_REQUEST_ACCEPTED(), $uid1, false, $uid2);
     } else {
         EventService::createEvent(EEvent::FRIEND_REQUEST_DENIED(), $uid2, true, $uid1);
         EventService::createEvent(EEvent::FRIEND_REQUEST_DENIED(), $uid1, false, $uid2);
     }
     self::dropRequest($req_id);
     //TODO Przemek popraw to!
     $check = Request::find()->select('req_id')->where(['user1_id' => $user2_id, 'user2_id' => $user1_id, 'req_type' => 'friend'])->one();
     if (!is_null($check)) {
         self::dropRequest($check['req_id']);
     }
 }
     break;
 case \common\components\EEvent::FRIEND_REQUEST_SENT():
     $icon = "fa-plus-circle";
     $color = "bg-aqua";
     $userConnected = $event->getConnectedUser();
     if ($userConnected != null) {
         if ($event->getConnectedData()->self_mode) {
             $content = "<a href='/user/" . $event->getEventOwner()->getUsername() . "'>" . Yii::t('app', 'You') . "</a>&nbsp" . Yii::t('app', "have send a friend request to") . "<a href='/user/" . $userConnected->getUsername() . "'> " . $userConnected->getFullName() . " </a>";
         } else {
             $content = "<a href='/user/" . $userConnected->getUsername() . "'>" . $userConnected->getFullName() . "</a>&nbsp" . Yii::t('app', "has send to you a friend request");
         }
     } else {
         throw new \yii\base\Exception("Impossible event : you cannot sent a friend request to yourself");
     }
     break;
 case \common\components\EEvent::FRIEND_REQUEST_ACCEPTED():
     $icon = "fa-user-plus";
     $color = "bg-orange";
     $userConnected = $event->getConnectedUser();
     if ($userConnected != null) {
         if ($event->getConnectedData()->self_mode) {
             $content = "<a href='/user/" . $event->getEventOwner()->getUsername() . "'>" . Yii::t('app', 'You') . "</a>&nbsp" . Yii::t('app', "have accepted a friend request from") . "<a href='/user/" . $userConnected->getUsername() . "'> " . $userConnected->getFullName() . " </a>";
         } else {
             $content = "<a href='/user/" . $userConnected->getUsername() . "'>" . $userConnected->getFullName() . "</a>&nbsp" . Yii::t('app', "has accepted your friend request");
         }
     } else {
         throw new \yii\base\Exception("Impossible event : you cannot accept a friend request to yourself");
     }
     break;
 case \common\components\EEvent::FRIEND_REQUEST_DENIED():
     $icon = "fa-minus-circle";