/** * Get An existing service consumer. * * @param string $consumerKey * @return \CultureFeed_Consumer * @throws \CultureFeed_ParseException */ public function getServiceConsumer($consumerKey) { $result = $this->oauth_client->consumerGetAsXML('serviceconsumer/' . $consumerKey); try { $xml = new CultureFeed_SimpleXMLElement($result); } catch (Exception $e) { throw new CultureFeed_ParseException($result); } $element = $xml->xpath('/consumer'); return $this->parseServiceConsumer($element[0]); }
/** * {@inheritdoc} */ public function getDistributionKeysForOrganizer($cdbid) { $result = $this->oauth_client->consumerGetAsXML('uitpas/distributionkey/organiser/' . $cdbid, array()); try { $xml = new CultureFeed_SimpleXMLElement($result); } catch (Exception $e) { throw new CultureFeed_ParseException($result); } $distribution_keys = array(); foreach ($xml->xpath('/response/cardSystems/cardSystem') as $cardSystemXml) { $cardSystem = CultureFeed_Uitpas_CardSystem::createFromXML($cardSystemXml); $objects = $cardSystemXml->xpath('distributionKeys/distributionKey'); foreach ($objects as $object) { $distributionKey = CultureFeed_Uitpas_DistributionKey::createFromXML($object); $distributionKey->cardSystem = $cardSystem; $distribution_keys[] = $distributionKey; } } $total = count($distribution_keys); return new CultureFeed_ResultSet($total, $distribution_keys); }