Пример #1
0
 /**
  * Get Webforms
  * @param int $id Webform ID
  * @return array
  */
 public function getWebForm($id)
 {
     $response = parent::getWebForm($id);
     $webForms = array();
     // Loop through the webforms, and get the campaign data for this form
     foreach ($response as $webFormId => $form) {
         $formArray = array();
         $formArray['webform_id'] = $webFormId;
         $formArray['data'] = $form;
         $campaignId = $form->campaign;
         $campaignResponse = $this->getCampaignByID($campaignId);
         $formArray['campaign'] = array('campaign_id' => $campaignId, 'data' => $campaignResponse->{$campaignId});
         array_push($webForms, $formArray);
     }
     if (!empty($webForms)) {
         return $webForms[0];
     } else {
         return $webForms;
     }
 }
 /**
  * @param string $apiKey
  * @param string $apiUrl
  * @return void
  */
 public function __construct($apiKey, $apiUrl = null)
 {
     parent::__construct($apiKey, $apiUrl);
     $this->client = new \JsonRpc\Client($this->apiUrl);
 }