public function actionMark($queue_name, $message_id = null, $subscriber_id = null, $returnUrl = null)
    {
        if (($subscriber_id = trim($subscriber_id)) === '') {
            $subscriber_id = null;
        }
        /** @var QueueInterface $queue */
        list($queue, $authItems) = $this->loadQueue($queue_name, ['nfy.message.read']);
        $this->verifySubscriber($queue, $subscriber_id);

        if ($authItems['nfy.message.read']) {
            if ($message_id === null) {
                $queue->receive($subscriber_id);
            } else {
                $queue->delete($message_id, $subscriber_id);
            }
        }
        return $this->redirect($returnUrl !== null ? $returnUrl : Yii::$app->user->returnUrl);
    }
public function actionMark($queue_name, $message_id = null, $subscriber_id = null, $returnUrl = null)
    {
        if (($subscriber_id = trim($subscriber_id)) === '') {
            $subscriber_id = null;
        }
        /** @var QueueInterface $queue */
        list($queue, $authItems) = $this->loadQueue($queue_name, ['nfy.message.read']);
        $this->verifySubscriber($queue, $subscriber_id);

        if ($authItems['nfy.message.read']) {
            if ($message_id === null) {
                $queue->receive($subscriber_id);
            } else {
                $queue->delete($message_id, $subscriber_id);
            }
        }
        return $this->redirect($returnUrl !== null ? $returnUrl : Yii::$app->user->returnUrl);
    }
public function actionMark ( $ queue_name , $ message_id = null , $ subscriber_id = null , $ returnUrl = null ) { if ( ( $ subscriber_id = trim ( $ subscriber_id ) ) === '' ) { $ subscriber_id = null ; } /** @var QueueInterface $queue */ list ( $ queue , $ authItems ) = $ this -> loadQueue ( $ queue_name , [ 'nfy.message.read' ] ) ; $ this -> verifySubscriber ( $ queue , $ subscriber_id ) ; if ( $ authItems [ 'nfy.message.read' ] ) { if ( $ message_id === null ) { $ queue -> receive ( $ subscriber_id ) ; } else { $ queue -> delete ( $ message_id , $ subscriber_id ) ; } } return $ this -> redirect ( $ returnUrl !== null ? $ returnUrl : Yii :: $ app -> user -> returnUrl ) ; }
Marks all messages or specified message as read.
@param $queue_name
@param mixed $message_id
@param mixed $subscriber_id
@param string $returnUrl
@return \yii\web\Response
Marks all messages or specified message as read .