Changes the status of the given comment.

@param int $id Comment id
@param string $status New status for the comment
@return void Redirects to previous page
355730
public function status($id, $status)
    {
        if (in_array($status, ['pending', 'approved', 'spam', 'trash'])) {
            $this->loadModel('Comment.Comments');
            if ($comment = $this->Comments->get($id)) {
                $comment->set('status', $status);
                $this->Comments->save($comment);
            }
        }

        $this->title(__d('comment', 'Change Comment Status'));
        $this->redirect($this->referer());
    }
900090
public function smsStatus($id)
    {
        $response = $this->request(
            'sms/status',
            [
                'id' => $id,
            ]
        );
        
        $response = explode("\n", $response);
        
        return new SmsStatusResponse(array_shift($response));
    }
369976
public function toggle($id, $status)
    {
        $this->App->toggleField($this->Extensions, $id, $status);
    }
842295
public function setStatus(\Sulu\Bundle\ProductBundle\Entity\Status $status)
    {
        $this->status = $status;

        return $this;
    }
25445
private function updateModerationStatus(Builder $builder, $id, $status)
    {

        //If $id parameter is passed then update the specified model
        if ($id) {
            $model = $builder->find($id);
            $model->{$model->getStatusColumn()} = $status;
            $model->{$model->getModeratedAtColumn()} = Carbon::now();
            //if moderated_by in enabled then append it to the update
            if ($moderated_by = $model->getModeratedByColumn()) {
                $model->{$moderated_by} = \Auth::user()->getKey();
            }

            $model->save();
            return $model;
        }

        $update = [
            $builder->getModel()->getStatusColumn() => $status,
            $builder->getModel()->getModeratedAtColumn() => Carbon::now()
        ];
        //if moderated_by in enabled then append it to the update
        if ($moderated_by = $builder->getModel()->getModeratedByColumn()) {
            $update[$builder->getModel()->getModeratedByColumn()] = \Auth::user()->getKey();
        }
        return $builder->update($update);
    }
92392
public static function setResponseStatus(int $status) : void
    {
        if (array_key_exists($status, Http::$http_status_messages)) {
            header('HTTP/1.1 ' . $status . ' ' . Http::$http_status_messages[$status]);
        }
    }
548786
public function setStatus($status) {
        if($this->setModified('status', $status)->isModified()) {
            $this->status = $status;
        }

        return $this;
    }
1032962
public function run($id, $status)
    {
        $model = $this->findModel($id);
        $model->load(Yii::$app->request->post());
        $changedStatus = $model->sendToStatus($status);
        $model->save();

        return $this->response(
            $changedStatus,
            $model
        );
    }
1319416
public function setIssueStatus($id, $status)
    {
        $api = $this->client->issue_status;
        $statusId = $api->getIdByName($status);

        return $this->update($id, [
            'status_id' => $statusId,
        ]);
    }
1022023
public function setUnread($id, $status)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/unread', array('value' => $status));
    }
869071
public function setStatus( $status )
	{
		if ( $status == $this->getStatus() ) { return; }

		$this->_values['status'] = (int) $status;
		$this->setModified();
	}
120766
public function postComment($id)
    {
        $text = isset($_POST["text"]) ? $_POST["text"] : "nothingfound";

        if ($text == "nothingfound") {
            return false;
        }
        $user = $this->di->get("session")->get("user");
        $comment = new Comment($this->di->get("db"));
        $comment->text = $text;
        $comment->parentId = $id;
        $comment->user = $user;
        $comment->save();
        return true;
    }
359868
public function setStatus($status)
    {
        if ($this->isValidStatus($status)) {
            $this->status = $status;
            $this->saveState();
        } else {
            throw new \InvalidArgumentException(
                sprintf("Status '%s' is not a valid status", $status)
            );
        }
    }
967565
protected function updatePost( $post_id, $status ) {

		$post = get_post( $post_id, 'ARRAY_A' );
		if ( empty( $post ) ) {
			return;
		}

		global $wpdb;
		$menu_order = $wpdb->get_var(
			$wpdb->prepare(
				"SELECT MAX(menu_order) FROM {$wpdb->posts} WHERE post_type = %s AND post_parent = %d AND ID != %d ",
				$post['post_type'],
				$post['post_parent'],
				$post_id
			)
		);
		if ( $menu_order !== null ) {
			$post['menu_order'] = $menu_order + 1;
		}

		$post['post_status'] = $status;

		wp_update_post( $post );
	}
1272246
function setStatus( $status )
    {
        if ( $status instanceof eZOrderStatus )
            $this->StatusID = $status->attribute( 'id' );
        else
            $this->StatusID = $status;
        $this->setStatusModified( time() );
    }
1197537
protected function updateStatus( $post, $status ) {

		// Update Post Status
		$this->modelService->updateStatus( $post, $status );

		return $this->checkStatus( $post );
	}
557229
protected function updateProcLine(string $status): void
    {
        if (function_exists('cli_set_process_title')) {
            cli_set_process_title(sprintf('qjitsu-%s: %s', $this->getWorkerType(), $status));
        }
    }