@param string $id
@param array  $headers

@throws Exception

@return array|string
437308
public function removeScheduledChanges(string $id, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/remove_scheduled_changes', $id);

        return $this->post($url, [], $headers);
    }
688378
public function run($id)
    {
        /** @var ActiveRecord $model */
        $model = $this->findModel($id);
        if ($this->checkAccess) {
            call_user_func($this->checkAccess, 'read', $model);
        }
        //create and cache proper query for breadcrumbs and maybe other things
        $this->getQuery($this->getSearchModel());
        // this headers is used in a modal dialog when getting a redirect after saving a form
        Yii::$app->getResponse()->getHeaders()->set('X-Primary-Key', $id);
        return [
            'model'      => $model,
            'attributes' => $this->getDetailAttributes($model, $this->getFields($model, 'detail')),
            'relations'  => $this->getModelRelations($model, $this->getExtraFields($model)),
        ];
    }
1136640
public function handlerById($id)
    {
        if (isset($this->_handlers[$id])) {
            return $this->_handlers[$id];
        }
        throw new \Exception("Property handler with id {$id} not found");
    }
903978
public function switchGatewayAccount(string $id, array $data, array $headers = [])
    {
        $url = $this->url('payment_sources/%s/switch_gateway_account', $id);

        return $this->post($url, $data, $headers);
    }
837075
public function getById(string $id, array $params = [])
    {
        return $this->executeRequest(
            RequestMethodEnum::GET,
            ResourceMethodEnum::GET_BY_ID,
            $params,
            $id
        );
    }
1136553
public function get($id)
    {
        if (empty($id)) {
            throw new \Exception('cannot load object with empty id');
        }

        $params = new RequestParams(RequestOps::GET, $this->resourceMetadata, $id);
        $jsonResponse = $this->request($params);

        if ($jsonResponse == false) {
            throw new Exception('Error retrieving data');
        }

        $inst = $this->createResourceInst($jsonResponse, $this->resourceMetadata->resourceClass);

        $this->postProcess($inst);

        return $inst;
    }
595121
public function findAsPdf(string $id, array $headers = [])
    {
        $url = $this->url('invoices/%s/pdf', $id);

        return $this->get($url, [], $headers);
    }
1171525
public function cancel(string $id, array $data, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/cancel', $id);

        return $this->post($url, $data, $headers);
    }
1074722
public function addIdHeader($name, $ids = null)
    {
        $this->storeHeader($name, $this->factory->createIdHeader($name, $ids));
    }
986660
public function archive(string $id, array $headers = [])
    {
        $url = $this->url('coupon_codes/%s/archive', $id);

        return $this->post($url, [], $headers);
    }
1309061
public function findTableHeader($id = null, array $relations = array())
    {
        return new Accessor\Table\TableHeaderAccessor($id, $relations, $this->con);
    }
1145658
public function retrieveWithScheduledChanges(string $id, array $headers = [])
    {
        $url = $this->url('subscriptions/%s/retrieve_with_scheduled_changes', $id);

        return $this->get($url, [], $headers);
    }
1106260
private function digToc($id, array $header, array &$headers){
		$keys = array_keys($headers);
		krsort($keys);
		$done = false;
		foreach( $keys as $key ){
			if( $headers[$key]['level'] < $header['level'] ){
				if( !$this->digToc($id, $header, $headers[$key]['children']) ){
					$headers[$key]['children'][$id] = $header;
				}
				return true;
			}
		}
		return false;
	}
113066
public function addChargeItem(string $id, array $data, array $headers = [])
    {
        $url = $this->url('invoices/%s/add_charge', $id);

        return $this->post($url, $data, $headers);
    }
905490
public function export(string $id, array $data, array $headers = [])
    {
        $url = $this->url('payment_sources/%s/export_payment_source', $id);

        return $this->post($url, $data, $headers);
    }
98306
public function acknowledge(string $id, array $headers = [])
    {
        $url = $this->url('hosted_pages/%s/acknowledge', $id);

        return $this->post($url, [], $headers);
    }
463812
public function display(Exception $exception, string $id, int $code, array $headers)
    {
        return cachet_redirect('auth.login')->withError(trans('forms.login.rate-limit'));
    }