Set the subscription to be canceled at the end of the current billing period.

@param int $id

@return Subscription
@see Subscription::setCancelAtEndOfPeriod()
@see Subscription::setCancellationMessage()
963082
public function cancelDelayed($id)
    {
        $this->setCancelAtEndOfPeriod(true);

        $service = $this->getService();
        $rawData = $this->getRawData(array('subscription' => $this->_params));
        $response = $service->request('subscriptions/' . (int)$id, 'PUT', $rawData);
        $responseArray = $this->getResponseArray($response);

        if (!$this->isError()) {
            $this->_data = $responseArray['subscription'];
        } else {
            $this->_data = array();
        }

        return $this;
    }
406734
public static function plan_cancel_review_request($id) {
        $params = self::validate_parameters(self::plan_cancel_review_request_parameters(), array(
            'id' => $id
        ));

        $plan = api::read_plan($id);
        self::validate_context($plan->get_context());

        return api::plan_cancel_review_request($plan);
    }
1179971
public function setId($id)
    {
        // blacklist
        if (!(is_string($id) and filter_var($id, \FILTER_VALIDATE_INT) !== false)
        and !is_int($id)) {
            throw new \InvalidArgumentException( "Integer ID expected." );
        }

        $this->id = (int) trim($id);

        return $this;
    }
956718
public function setSubscribed($id, $subscribed)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/subscribed', array('value' => $subscribed));
    }
161527
public function setId($id)
    {
        $this->getTabs()->each(function (TabInterface $tab) use ($id) {
            if ($tab instanceof FormInterface) {
                $tab->setId($id);
            }
        });

        return $this;
    }
1361705
public function setMessageId($id = true)
    {
        if ($id === null || $id === false) {
            return $this;
        } elseif ($id === true) {
            $id = $this->createMessageId();
        }

        if ($this->_messageId === null) {
            $id = $this->_filterOther($id);
            $this->_messageId = $id;
            $this->_storeHeader('Message-Id', '<' . $this->_messageId . '>');
        } else {
            /**
             * @see Zend_Mail_Exception
             */
            // require_once 'Zend/Mail/Exception.php';
            throw new Zend_Mail_Exception('Message-ID set twice');
        }

        return $this;
    }
892014
public function cancel()
    {
        $subscription = $this->asBraintreeSubscription();

        if ($this->onTrial()) {
            BraintreeSubscription::cancel($subscription->id);

            $this->markAsCancelled();
        } else {
            BraintreeSubscription::update($subscription->id, [
                'numberOfBillingCycles' => $subscription->currentBillingCycle,
            ]);

            $this->ends_at = $subscription->billingPeriodEndDate;

            $this->save();
        }

        return $this;
    }
977767
public function cancelNow()
    {
        $subscription = $this->asBraintreeSubscription();

        BraintreeSubscription::cancel($subscription->id);

        $this->markAsCancelled();

        return $this;
    }
883900
public function cancelSubscription($subscriptionId)
    {
        return $this->client->subscriptions->cancelFor($this, $subscriptionId, $this->getPresetOptions());
    }
907016
public function removeById($id)
    {
        if (isset($this->ids[$id])) {
            foreach ($this->ids[$id] as $alias) {
                unset($this->aliases[$alias]);
            }
            unset($this->ids[$id]);
        }

        return $this;
    }
711200
public function setId(int $id): Chat
    {
        Assert::greaterThan($id, 0);

        $this->id = $id;

        return $this;
    }
608465
public function setId(int $id): Customer
    {
        Assert::greaterThan($id, 0);

        $this->id = $id;

        return $this;
    }
1249095
public function setSelected($id) {
        foreach ($this->radio_buttons as $k => $radio) {
            /* @var $radio InputRadio */
            if ((int)$k === (int)$id) {
                $radio->setSelected(true);
            } else {
                $radio->setSelected(false);
            }
        }

        return $this;
    }
345320
public function & SetId ($id) {
		/** @var $this \MvcCore\Ext\Forms\IForm */
		$this->id = $id;
		self::$instances[$id] = & $this;
		return $this;
	}
554269
public function setId($id)
    {
        if (!is_int($id) && !is_null($id)) {
            throw new \InvalidArgumentException(__CLASS__ . ' ' . __METHOD__ . ': Not an integer');
        }

        $this->id = $id;

        return $this;
    }
1066227
public function set_last_insert_id($id=''): self
  {
    if ( $id === '' ){
      if ( $this->id_just_inserted ){
        $id = $this->id_just_inserted;
        $this->id_just_inserted = null;
      }
      else{
        $id = $this->lastInsertId();
        if ( \is_string($id) && str::is_integer($id) ){
          $id = (int)$id;
        }
      }
    }
    else{
      $this->id_just_inserted = $id;
    }
    $this->last_insert_id = $id;
    return $this;
  }
895459
public function setId($Id) 
    {
        if (!$this->_isNumericArray($Id)) {
            $Id =  array ($Id);    
        }
        $this->fields['Id']['FieldValue'] = $Id;
        return $this;
    }