Exemplo n.º 1
0
 function APIlityAd($id, $belongsToAdGroupId, $displayUrl, $destinationUrl, $status, $isDisapproved, $adType)
 {
     $this->id = $id;
     $this->belongsToAdGroupId = $belongsToAdGroupId;
     $this->displayUrl = $displayUrl;
     $this->destinationUrl = $destinationUrl;
     $this->status = $status;
     $this->isDisapproved = convertBool($isDisapproved);
     $this->adType = $adType;
 }
Exemplo n.º 2
0
 function setIsPaused($newFlag)
 {
     // update the google servers
     $soapClients =& APIlityClients::getClients();
     $someSoapClient = $soapClients->getCriterionClient();
     if (isset($this->text)) {
         $criterionType = "Keyword";
     } else {
         $criterionType = "Website";
     }
     // make sure bool gets transformed into string correctly
     if ($newFlag) {
         $newFlag = "true";
     } else {
         $newFlag = "false";
     }
     $soapParameters = "<updateCriteria>\n                           <criteria>\n                             <id>" . $this->getId() . "</id>\n                             <adGroupId>" . $this->getBelongsToAdGroupId() . "\n                             </adGroupId>\n                             <paused>" . $newFlag . "</paused>\n                             <criterionType>" . $criterionType . "</criterionType>\n                             <destinationUrl>" . $this->getDestinationUrl() . "</destinationUrl>\n                           </criteria>\n                         </updateCriteria>";
     // update the keyword on the google servers
     $someSoapClient->call("updateCriteria", $soapParameters);
     $soapClients->updateSoapRelatedData(extractSoapHeaderInfo($someSoapClient->getHeaders()));
     if ($someSoapClient->fault) {
         pushFault($someSoapClient, $_SERVER['PHP_SELF'] . ":setIsPaused()", $soapParameters);
         return false;
     }
     // update local object
     $this->isPaused = convertBool($newFlag);
     return true;
 }
Exemplo n.º 3
0
 function setIsEnabledOptimizedAdServing($newFlag)
 {
     // update google servers
     // make sure bool gets transformed to string correctly
     if ($newFlag) {
         $newFlag = "true";
     } else {
         $newFlag = "false";
     }
     $soapParameters = "<setOptimizeAdServing>\n                           <campaignId>" . $this->getId() . "</campaignId>\n                           <enable>" . $newFlag . "</enable>\n                         </setOptimizeAdServing>";
     $soapClients =& APIlityClients::getClients();
     $someSoapClient = $soapClients->getCampaignClient();
     // set the new optimize adserving flag on the server
     $someSoapClient->call("setOptimizeAdServing", $soapParameters);
     $soapClients->updateSoapRelatedData(extractSoapHeaderInfo($someSoapClient->getHeaders()));
     if ($someSoapClient->fault) {
         pushFault($someSoapClient, $_SERVER['PHP_SELF'] . ":setIsEnabledOptimizedAdServing()", $soapParameters);
         return false;
     }
     // update local object
     $this->isEnabledOptimizedAdServing = convertBool($newFlag);
     return true;
 }