Read component for a subscription

@param int $subscriptionId
@param int $componentId

@return Component
330276
public function readSubscription($subscriptionId, $componentId)
    {
        $service = $this->getService();

        $response      = $service->request('subscriptions/' . (int)$subscriptionId . '/components/' . (int)$componentId, 'GET');
        $responseArray = $this->getResponseArray($response);

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

        return $this;
    }
924959
public function pushSetSubscriptionState($subscriptionID, $stateValue)
    {
        $data = array(
            'id' => $subscriptionID,
            'state' => $stateValue,
        );

        $requestResult = $this->sendRequest('push/subscriptions/state', 'POST', $data);

        return $this->handleResult($requestResult);
    }
178805
public function toComponent(string $componentId)
    {
        if ($this->hidden) {
            throw InvalidOperationException::format('Invalid call to %s: cannot hide an existing column', __METHOD__);
        }

        call_user_func($this->componentIdCallback, $componentId);
    }
1002062
public function renewSubscription($subscriptionId)
    {
        $requestData = new Renew\RequestData($subscriptionId);
        $request = new Renew\Request($requestData);

        return $this->sendRequest($request, Renew\ApiResponse::class);
    }
846436
protected function _getTrlRow($proxiedRow, $componentId)
    {
        $row = null;
        $proxyId = $proxiedRow->id;
        $select = $this->_trlModel->select()
            ->whereEquals('component_id', $componentId)
            ->whereEquals('master_id', $proxyId);
        $trlRow = $this->_trlModel->getRows($select)->current();
        if ($trlRow) {
            $row = $trlRow;
        } else {
            $row = $this->_trlModel->createRow();
            $row->master_id = $proxyId;
            $row->component_id = $componentId;
            $row->save();
        }
        return $row;
    }
1371308
public function createVue($id, $componentName, $component, $data = [])
    {
        return $this->service->createVue($id, $componentName, $component, $data);
    }
1014335
protected function addToComponentTree($componentId, array $componentPath, array &$tree)
    {
        // If the component has to be placed in a subpath
        if (count($componentPath)) {
            $subpath = array_shift($componentPath);
            if (empty($tree[$subpath])) {
                $tree[$subpath] = [];
            }
            $this->addToComponentTree($componentId, $componentPath, $tree[$subpath]);

            return;
        }

        $tree[] = $componentId;
    }
433540
public Set<String> getComponentStreams(String componentId) {
    if (outputs.containsKey(componentId)) {
      Set<String> streams = new HashSet<>();
      List<TopologyAPI.OutputStream> olist = outputs.get(componentId);
      for (TopologyAPI.OutputStream ostream : olist) {
        streams.add(ostream.getStream().getId());
      }
      return streams;
    } else {
      return null;
    }
  }
1060618
public function cancel($reference = null, $subscriptionId = null)
    {
        if ($reference) {
          $this->setParameter('REFERENCE', $reference);
        }

        if ($subscriptionId) {
          $this->setParameter('ABONNEMENT', $subscriptionId);
        }

        $this->transport->setEndpoint($this->getUrl());

        return $this->transport->call($this);
    }
305026
protected function getComponentTitle($componentId)
    {
        $component      =& $this->graphComponents[$componentId];
        $componentTitle = implode('/', array_filter(array_merge($component['path'], [$component['id']])));
        $componentTitle .= ' ('.$component['class'].')';

        return $componentTitle;
    }
927366
public static function getSubscriptions(Network $network, $userId) {
		$url = self::getSubscriptionUrl($network, $network->getUrnForUser($userId));

		$response = Client::GET($url, self::getHeaders($network));

		$body = self::getDataFromResponse($response);
		if (!property_exists($body, "subscriptions")) {
			return null;
		}

		$subscriptions = array();
		foreach ($body->{"subscriptions"} as &$sub) {
			$subscriptions[] = Subscription::serializeFromJson($sub);
		}

		return $subscriptions;
	}
199187
public function orderBy(string $componentId, string $direction)
    {
        list($column, $component) = $this->structure->getColumnAndComponent($componentId);

        $this->orderings[] = new ColumnOrdering($column, $component, $direction);

        return $this;
    }
878187
private function resolveStorageId(string $key, string $componentId): string
    {
        return sprintf('%s.%s', rtrim($key, 's'), $componentId);
    }
956718
public function setSubscribed($id, $subscribed)
    {
        return $this->put($this->getPath().'/'.rawurlencode($id).'/subscribed', array('value' => $subscribed));
    }
989885
private function parseSubscription($subscription)
    {
        /** @var SubscriptionInterface $subscriptionItem */
        $subscriptionItem = $this->subscriptionFactory->create();

        foreach ($subscription->getData() as $key => $value) {
            $subscriptionItem->setData($key, $value);
        }

        return $subscriptionItem;
    }
367444
public function getSubscriptionInvoices(int $subscriptionId): array
    {
        $results = $this->_createInvoiceQuery()
            ->where(['subscriptionId' => $subscriptionId])
            ->orderBy(['dateCreated' => SORT_DESC])
            ->all();

        $invoices = [];

        foreach ($results as $result) {
            $result['invoiceData'] = Json::decodeIfJson($result['invoiceData']);
            $invoices[] = new Invoice($result);
        }

        return $invoices;
    }
756280
public function getComponentById($componentId, $select = array())
    {
        if (!$componentId) return null;

        if (is_array($select)) {
            $partTypes = array_keys($select);
        } else {
            $partTypes = $select->getPartTypes();
        }
        if (!$partTypes || $partTypes == array(Kwf_Component_Select::IGNORE_VISIBLE)) {
            if (isset($this->_dataCache[$componentId])) {
                return $this->_dataCache[$componentId];
            }
            if (is_array($select)) {
                if (isset($select[Kwf_Component_Select::IGNORE_VISIBLE])) {
                    $ignoreVisible = $select[Kwf_Component_Select::IGNORE_VISIBLE];
                } else {
                    $ignoreVisible = false;
                }
            } else {
                $ignoreVisible = $select->getPart(Kwf_Component_Select::IGNORE_VISIBLE);
            }
            if ($ignoreVisible && isset($this->_dataCacheIgnoreVisible[$componentId])) {
                return $this->_dataCacheIgnoreVisible[$componentId];
            }
        }
        if (is_array($select)) {
            $select = new Kwf_Component_Select($select);
        } else {
            $select = clone $select;
        }
        $ret = $this;
        $idParts = $this->_getIdParts($componentId);

        //Optimierung: wenn bereits ein parent der gesuchten komponente existiert, dieses direkt verwenden
        //hilft vorallem wenn das parent deserialisiert wurde da in dem fall die weiteren parents nicht erstellt werden müssen
        for($i=0; $i<count($idParts); ++$i) {
            $id = implode('', array_slice($idParts, 0, count($idParts)-$i-1));
            $found = false;
            if (isset($this->_dataCache[$id])) {
                $ret = $this->_dataCache[$id];
                $found = true;
            } else {
                if (is_array($select)) {
                    if (isset($select[Kwf_Component_Select::IGNORE_VISIBLE])) {
                        $ignoreVisible = $select[Kwf_Component_Select::IGNORE_VISIBLE];
                    } else {
                        $ignoreVisible = false;
                    }
                } else {
                    $ignoreVisible = $select->getPart(Kwf_Component_Select::IGNORE_VISIBLE);
                }
                if ($ignoreVisible && isset($this->_dataCacheIgnoreVisible[$id])) {
                    $ret = $this->_dataCacheIgnoreVisible[$id];
                    $found = true;
                }
            }
            if ($found) {
                $idParts = array_slice($idParts, count($idParts)-$i-1);
                break;
            }
        }

        foreach ($idParts as $i=>$idPart) {
            if ($idPart == 'root') {
                $ret = $this;
            } else {
                if ($i+1 == count($idParts)) {
                    //nur bei letzem part select berücksichtigen
                    $select->whereId($idPart);
                    $s = $select;
                } else {
                    $s = array('id'=>$idPart);
                    if ($select->hasPart(Kwf_Component_Select::IGNORE_VISIBLE)) {
                        //ignoreVisible doch mitnehmen damit wir unterkomponeten von unsichtbaren
                        //komponenten finden
                        $s['ignoreVisible'] = $select->getPart(Kwf_Component_Select::IGNORE_VISIBLE);
                    }
                    if ($select->hasPart(Kwf_Component_Select::WHERE_SUBROOT)) {
                        //ignoreVisible doch mitnehmen damit wir unterkomponeten von unsichtbaren
                        //komponenten finden
                        $s['subroot'] = $select->getPart(Kwf_Component_Select::WHERE_SUBROOT);
                    }
                    $s = new Kwf_Component_Select($s);
                }
                if ($i == 0 && !$found) { // Muss eine Page sein
                    $ret = null;
                    $generators = $this->getPageGenerators();
                    foreach ($generators as $generator) {
                        $ret = $generator->getChildData(null, $s);
                        $ret = array_pop($ret);
                        if ($ret) break;
                    }
                } else {
                    $ret = $ret->getChildComponent($s);
                }
                if (!$ret) break;
            }
        }
        return $ret;
    }