Source of file CMResources.php
Size: 1,137 Bytes - Last Modified: 2021-12-23T10:53:26+00:00
/var/www/docs.ssmods.com/process/src/code/Objects/CMResources.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 | <?php /** * Represents a list of all base resources associated with a single api key * within Campaign Monitor * * @author Damian Mooyman */ class CMResources extends CMBase { /** * Returns all clients accessible with the current api key * * @return ArrayList[CMClient] * @throws CMError */ function Clients() { $interface = new CS_REST_General($this->apiKey); $result = $interface->get_clients(); $response = $this->parseResult($result); // Save each client $clients = new ArrayList(); foreach($response as $clientData) { $clients->push(new CMClient($this->apiKey, $clientData)); } return $clients; } /** * Retrieves the details of a client by ID * * @param string $clientID The client identifier * @return CMClient */ function getClient($clientID) { $client = new CMClient($this->apiKey); $client->LoadByID($clientID); return $client; } /** * Retrieves a single list by ID * * @param string $listID The list identifier * @return CMList */ function getList($listID) { $list = new CMList($this->apiKey); $list->LoadByID($listID); return $list; } } |