public function actionMark($id = null)
    {
        $model = Subscription::find()->where(['id' => $id, 'user_id' => User::loggedId()])->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find Subscription with this ID.'));
            return $this->redirect(['profile/subscriptions']);
        }
        if ($model->post_seen == Subscription::POST_SEEN) {
            if ($model->unseen()) {
                $this->success(Yii::t('podium/flash', 'Thread has been marked unseen.'));
            } else {
                Log::error('Error while marking thread', $model->id, __METHOD__);
                $this->error(Yii::t('podium/flash', 'Sorry! There was some error while marking the thread.'));
            }
            return $this->redirect(['profile/subscriptions']);
        }
        if ($model->post_seen == Subscription::POST_NEW) {
            if ($model->seen()) {
                $this->success(Yii::t('podium/flash', 'Thread has been marked seen.'));
            } else {
                Log::error('Error while marking thread', $model->id, __METHOD__);
                $this->error(Yii::t('podium/flash', 'Sorry! There was some error while marking the thread.'));
            }
            return $this->redirect(['profile/subscriptions']);
        }
        $this->error(Yii::t('podium/flash', 'Sorry! Subscription has got the wrong status.'));
        return $this->redirect(['profile/subscriptions']);
    }
public function actionMark($id = null)
    {
        $model = Subscription::find()->where(['id' => $id, 'user_id' => User::loggedId()])->limit(1)->one();
        if (empty($model)) {
            $this->error(Yii::t('podium/flash', 'Sorry! We can not find Subscription with this ID.'));
            return $this->redirect(['profile/subscriptions']);
        }
        if ($model->post_seen == Subscription::POST_SEEN) {
            if ($model->unseen()) {
                $this->success(Yii::t('podium/flash', 'Thread has been marked unseen.'));
            } else {
                Log::error('Error while marking thread', $model->id, __METHOD__);
                $this->error(Yii::t('podium/flash', 'Sorry! There was some error while marking the thread.'));
            }
            return $this->redirect(['profile/subscriptions']);
        }
        if ($model->post_seen == Subscription::POST_NEW) {
            if ($model->seen()) {
                $this->success(Yii::t('podium/flash', 'Thread has been marked seen.'));
            } else {
                Log::error('Error while marking thread', $model->id, __METHOD__);
                $this->error(Yii::t('podium/flash', 'Sorry! There was some error while marking the thread.'));
            }
            return $this->redirect(['profile/subscriptions']);
        }
        $this->error(Yii::t('podium/flash', 'Sorry! Subscription has got the wrong status.'));
        return $this->redirect(['profile/subscriptions']);
    }
public function actionMark ( $ id = null ) { $ model = Subscription :: find ( ) -> where ( [ 'id' => $ id , 'user_id' => User :: loggedId ( ) ] ) -> limit ( 1 ) -> one ( ) ; if ( empty ( $ model ) ) { $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! We can not find Subscription with this ID.' ) ) ; return $ this -> redirect ( [ 'profile/subscriptions' ] ) ; } if ( $ model -> post_seen == Subscription :: POST_SEEN ) { if ( $ model -> unseen ( ) ) { $ this -> success ( Yii :: t ( 'podium/flash' , 'Thread has been marked unseen.' ) ) ; } else { Log :: error ( 'Error while marking thread' , $ model -> id , __METHOD__ ) ; $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! There was some error while marking the thread.' ) ) ; } return $ this -> redirect ( [ 'profile/subscriptions' ] ) ; } if ( $ model -> post_seen == Subscription :: POST_NEW ) { if ( $ model -> seen ( ) ) { $ this -> success ( Yii :: t ( 'podium/flash' , 'Thread has been marked seen.' ) ) ; } else { Log :: error ( 'Error while marking thread' , $ model -> id , __METHOD__ ) ; $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! There was some error while marking the thread.' ) ) ; } return $ this -> redirect ( [ 'profile/subscriptions' ] ) ; } $ this -> error ( Yii :: t ( 'podium/flash' , 'Sorry! Subscription has got the wrong status.' ) ) ; return $ this -> redirect ( [ 'profile/subscriptions' ] ) ; }
Marking the subscription of given ID.
@param int $id
@return Response
Marking the subscription of given ID .