Send changed status to Yandex.Market

@param int $orderId
@param string $status
@param null|string $subStatus
@return Order

@link http://api.yandex.ru/market/partner/doc/dg/reference/put-campaigns-id-orders-id-status.xml
492136
public function setOrderStatus($orderId, $status, $subStatus = null)
    {
        $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '/status.json';

        $data = [
            "order" => [
                "status" => $status
            ]
        ];
        if ($subStatus) {
            $data['order']['substatus'] = $subStatus;
        }

        $response = $this->sendRequest(
            'PUT',
            $this->getServiceUrl($resource),
            [
                'json' => $data
            ]
        );

        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        $updateOrderStatusResponse = new UpdateOrderStatusResponse($decodedResponseBody);
        return $updateOrderStatusResponse->getOrder();
    }
679121
private function addStatusToOrder($id, $status)
    {
        $order = $this->_order->load($id);
        $order->addStatusToHistory($this->getStatusFromPaymentKey($status), null, true);
        $order->save();
    }
1211342
public function changeStatus($newStatus)
	{
		//Не меняем статус с "на возврате" на статус "оплачено"
		if ($this->status == self::C_ORDER_STATUS_RETURNING &&
			$newStatus == self::C_ORDER_STATUS_PAID
		) {
			return;
		}

		if ($this->status != $newStatus) {

			Order::whereId($this->id)
				->whereStatus($this->status)
				->update(array('status' => $newStatus));

		}

		$order = Order::find($this->id);
		$this->status = $order->status;

	}
548786
public function setStatus($status) {
        if($this->setModified('status', $status)->isModified()) {
            $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);
    }
143385
public function setStatusTo(\Sulu\Bundle\Sales\ShippingBundle\Entity\ShippingStatus $statusTo)
    {
        $this->statusTo = $statusTo;
    
        return $this;
    }
443294
public function setVisibility(string $poiId, int $status)
    {
        if (!in_array($status, [0, 1], true)) {
            throw new InvalidArgumentException('status should be 0 or 1.');
        }

        return $this->httpPostJson('wxa/setnearbypoishowstatus', [
            'poi_id' => $poiId,
            'status' => $status,
        ]);
    }
98079
public static function status($orderId)
    {
        $url = static::classUrl();
        $url = $url . '/' . $orderId . '/status';
        list($ret) = parent::staticRequest('get', $url, []);

        return $ret;
    }
313231
public function setStatus(\Sulu\Bundle\Sales\ShippingBundle\Entity\ShippingStatus $status)
    {
        $this->status = $status;
    
        return $this;
    }
1167697
public function entriesStatusChangeAction($status, Request $request)
    {
        $entries = [];
        $serializedEntries = [];
        $entriesParams = $this->decodeIdsString($request, 'Claroline\ClacoFormBundle\Entity\Entry');

        foreach ($entriesParams as $entryParam) {
            if (!$entryParam->isLocked()) {
                $entries[] = $entryParam;
            }
        }
        foreach ($entries as $entry) {
            $this->clacoFormManager->checkEntryModeration($entry);
        }
        $updatedEntries = $this->clacoFormManager->changeEntriesStatus($entries, intval($status));

        foreach ($updatedEntries as $entry) {
            $serializedEntries[] = $this->entrySerializer->serialize($entry);
        }

        return new JsonResponse($serializedEntries, 200);
    }
769029
protected function _setOrderStatus($status)
    {
        $paymentTypeObject = $this->getPaymentType();
        $paymentType = $paymentTypeObject ? $paymentTypeObject->getFieldData('oxpaymentsid') : null;
        if ($paymentType != 'oxidpaypal' || $status != self::OEPAYPAL_TRANSACTION_STATUS_OK) {
            parent::_setOrderStatus($status);
        }
    }
1033612
public function setStatus($contentId, $version, $status)
    {
        $q = $this->dbHandler->createUpdateQuery();
        $q->update(
            $this->dbHandler->quoteTable('ezcontentobject_version')
        )->set(
            $this->dbHandler->quoteColumn('status'),
            $q->bindValue($status, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('modified'),
            $q->bindValue(time(), null, \PDO::PARAM_INT)
        )->where(
            $q->expr->lAnd(
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('contentobject_id'),
                    $q->bindValue($contentId, null, \PDO::PARAM_INT)
                ),
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('version'),
                    $q->bindValue($version, null, \PDO::PARAM_INT)
                )
            )
        );
        $statement = $q->prepare();
        $statement->execute();

        if ((bool)$statement->rowCount() === false) {
            return false;
        }

        if ($status !== APIVersionInfo::STATUS_PUBLISHED) {
            return true;
        }

        // If the version's status is PUBLISHED, we set the content to published status as well
        $q = $this->dbHandler->createUpdateQuery();
        $q->update(
            $this->dbHandler->quoteTable('ezcontentobject')
        )->set(
            $this->dbHandler->quoteColumn('status'),
            $q->bindValue(ContentInfo::STATUS_PUBLISHED, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('current_version'),
            $q->bindValue($version, null, \PDO::PARAM_INT)
        )->where(
            $q->expr->eq(
                $this->dbHandler->quoteColumn('id'),
                $q->bindValue($contentId, null, \PDO::PARAM_INT)
            )
        );
        $statement = $q->prepare();
        $statement->execute();

        return (bool)$statement->rowCount();
    }
713018
function status($pubnub, $status)
    {

        if (!$this->_subscription->keepPolling()) {
            $sub = $this->_subscription->subscription();
            $e = new PubNubUnsubscribeException();
            $e->setChannels($sub['deliveryMode']['address']);
            throw $e;
        }

        $cat = $status->getCategory();

        if ($cat === PNStatusCategory::PNUnexpectedDisconnectCategory ||
            $cat === PNStatusCategory::PNTimeoutCategory
        ) {
            $this->_subscription->pubnubTimeoutHandler();
        }

    }
1095680
public function setStatus($status)
    {
        if($entity = $this->getIterator()->current()) {
            $entity->setStatusMessage($status);
        }

        return $this;
    }
252624
public void updatePostStatus(final long postId,
                                final Post.Status status) throws SQLException {
      Connection conn = null;
      PreparedStatement stmt = null;
      try {
         conn = connectionSupplier.getConnection();
         stmt = conn.prepareStatement(updatePostStatusSQL);
         stmt.setString(1, status.toString().toLowerCase());
         stmt.setLong(2, postId);
         stmt.executeUpdate();
      } finally {
         SQLUtil.closeQuietly(conn, stmt);
      }
   }
887509
public function update(string $cardId, string $encryptCode, string $status)
    {
        $params = [
            'card_id' => $cardId,
            'encrypt_code' => $encryptCode,
            'reimburse_status' => $status,
        ];

        return $this->httpPostJson('cgi-bin/card/invoice/reimburse/updateinvoicestatus', $params);
    }
1317510
public function update(OpportunityStatus $opportunityStatus): OpportunityStatus
    {
        $id = $opportunityStatus->getId();

        $opportunityStatus->setId(null);

        $response = $this->client->put($this->prepareUrlForKey('update-status', ['id' => $id]), [], $opportunityStatus->jsonSerialize());
        $responseData = $response->getDecodedBody();

        return new OpportunityStatus($responseData);
    }