public function actionFavorit()
 {
     $post = Yii::$app->request->post();
     $response = [];
     if (Yii::$app->user->isGuest) {
         $response['error'] = Yii::t('yii', 'Вы не авторизованы!');
     } else {
         if (!Photo::checkFavoritPhoto($post['photo_id'], Yii::$app->user->getId())) {
             Photo::favoritPhoto($post['photo_id'], Yii::$app->user->getId());
             Rating::favor($post['photo_id'], Rating::PHOTO, 1);
             $response['success'] = '+';
         } else {
             Photo::disFavoritPhoto($post['photo_id'], Yii::$app->user->getId());
             Rating::favor($post['photo_id'], Rating::PHOTO, -1);
             $response['success'] = '-';
         }
         $response['cnt_favorite'] = Photo::getCountFavorite($post['photo_id']);
         echo json_encode($response);
     }
 }