public function find($v = NULL, $role = NULL) { if (empty($v) || is_null($v)) { $this->set_error("You must supply a numeric partner_network_id to search for a partner."); return false; } $query = array(); if (!is_numeric($v)) { if (empty($v) && empty($role)) { $this->set_error("You must supply either one keyword or the role in order to search for partners."); return false; } if (!is_null($v)) { array_push($query, "keyword=" . urlencode($v)); } if (!is_null($role)) { $role = strolower($rolw); if ($role == "content_owner" || $role == "distributor" || $role == "reseller") { array_push($query, "role=" . $role); } } $path = ".xml?" . implode("&", $query); } else { $path = $this->root_path . "/" . $v . ".xml"; } $this->method = "GET"; return $this->call($path, $v); }
public function getMessage($status) { $status = strolower($status); if (array_key_exists($status, $this->m_messXml) == true) { return $this->m_messXml[$status]["de"]["xmlValue"]; } }
public function setFreqency($frequency) { $frequency = trim(strolower($frequency)); if (!in_array($frequency, $this->frequencies)) { throw new InvalidArgumentException('Frequency must with one of ' . join(', ', $this->frequencies)); } $this->frequency = $frequency; }
public function find($id = NULL, $type = "nightly", $tag = NULL) { if (!is_numeric($id)) { $this->set_error("The Placement ID must be numeric to extract forecasting results."); return false; } $query = NULL; $type = strolower($type); if (!is_null($tag)) { $type = "demand_result"; $query = "?tag=" . $tag; } if ($type == "demand_result" && is_null($tag)) { $xml = $this->call($this->root_path . "/" . $id . "/nightly.xml", 1); if (!$this->errors()) { $this->find($id, $type, $xml['tag']); exit; } else { return false; } } $this->method = "GET"; return $this->call($this->root_path . "/" . $id . "/" . $type . ".xml" . $query, 1); }
/** * callback for output buffering * (shouldn't really be called manually) * * @param string $data Buffered output * @return string Data to send to browser */ public function _flush($data) { if ($this->_cancel) { return $data; } $contentType = null; $storedHeaders = array(); $headersList = headers_list(); foreach($this->_specificOptions['memorize_headers'] as $key=>$headerName) { foreach ($headersList as $headerSent) { $tmp = split(':', $headerSent); $headerSentName = trim(array_shift($tmp)); if (strolower($headerName) == strtolower($headerSentName)) { $headerSentValue = trim(implode(':', $tmp)); $storedHeaders[] = array($headerSentName, $headerSentValue); } } } $array = array( 'data' => $data, 'headers' => $storedHeaders ); $this->save($array); return $data; }