affiliate = $affiliate; $this->creative = $creative; } public function getTrackingKey() { $trackingKey = new WPAM_Tracking_TrackingKey(); $trackingKey->setAffiliateRefKey($this->affiliate->uniqueRefKey); $trackingKey->setCreativeId($this->creative->creativeId); return $trackingKey; } public function getUrl() { return add_query_arg( array( WPAM_PluginConfig::$RefKey => $this->getTrackingKey()->pack() ), site_url( trim( $this->creative->slug ) ) ); } public function getHtmlSnippet() { switch ($this->creative->type) { case 'image': $html = "getUrl() . "\">"; $html .= "creative->imagePostId) . "\" style=\"border: 0;\" title=\"{$this->creative->altText}\"/>"; $html .= ""; return $html; case 'text': $html = "getUrl() . "\" title=\"{$this->creative->altText}\">"; $html .= $this->creative->linkText; $html .= ""; return $html; default: return NULL; } } }