コード例 #1
0
ファイル: Request.php プロジェクト: onigoetz/prediggo-php
 /**
  * {@inheritdoc}
  */
 protected function getArgumentMap()
 {
     $argMap = parent::getArgumentMap();
     $bufferKeys = "";
     $bufferValues = "";
     //implode the key values pairs into separate strings
     Utils::implodeKeyValuePairsToSeparatedString($this->parameter->getBasketItems(), "_/_", $bufferKeys, $bufferValues);
     //add parameters
     $argMap["classIDs"] = $bufferKeys;
     $argMap["itemIDs"] = $bufferValues;
     return $argMap;
 }
コード例 #2
0
ファイル: Request.php プロジェクト: onigoetz/prediggo-php
 /**
  * Creates a key value array of the parameters that need to be passed by  url.
  * @return array A key value map.
  */
 protected function getArgumentMap()
 {
     $argMap = parent::getArgumentMap();
     //item infos
     $argMap["itemID"] = $this->parameter->getItemInfo()->getItemId();
     $argMap["name"] = $this->parameter->getItemInfo()->getItemName();
     $bufferKeys = "";
     $bufferValues = "";
     //implode the key values pairs into separate strings
     Utils::implodeKeyValuePairsToSeparatedString($this->parameter->getItemInfo()->getAttributes(), "_/_", $bufferKeys, $bufferValues);
     //add parameters
     $argMap["itemInfoAttributeNames"] = $bufferKeys;
     $argMap["itemInfoAttributeValues"] = $bufferValues;
     return $argMap;
 }
コード例 #3
0
ファイル: Request.php プロジェクト: onigoetz/prediggo-php
 /**
  * Creates a key value array of the parameters that need to be passed by url.
  * @return array A key value map.
  */
 protected function getArgumentMap()
 {
     $argMap = parent::getArgumentMap();
     //common paramters for all getXXXRecommendation style queries...
     $argMap["nbRec"] = $this->parameter->getNbRecommendation();
     $argMap["showAds"] = $this->parameter->getShowAds() ? "true" : "false";
     $argMap["userID"] = $this->parameter->getUserId();
     $argMap["classID"] = $this->parameter->getProfileMapId();
     $argMap["languageCode"] = $this->parameter->getLanguageCode();
     $argMap["referURL"] = $this->parameter->getRefererUrl();
     $bufferKeys = "";
     $bufferValues = "";
     //implode the key values pairs into separate strings
     Utils::implodeKeyValuePairsToSeparatedString($this->parameter->getConditions(), "_/_", $bufferKeys, $bufferValues);
     //add parameters
     $argMap["attributeNames"] = $bufferKeys;
     $argMap["attributeValues"] = $bufferValues;
     return $argMap;
 }
コード例 #4
0
 /**
  * Adds a new attribute to this item description.
  * @param string $attributeName The name of the attribute you want to specify.
  * @param string $value The attribute value.
  */
 public function addAttribute($attributeName, $value)
 {
     Utils::addPairToUniqueArray($this->attributes, $attributeName, $value);
 }
コード例 #5
0
ファイル: Param.php プロジェクト: onigoetz/prediggo-php
 /**
  * Adds a range condition to the filter ( min <= value <=  max).
  *
  * @param string $attributeName The name of the attribute which you want to filter.
  * @param string $minValue The minimum value
  * @param string $maxValue The maximum value
  * @param bool $minInclusive true if values that are equal to the min boundary are accepted
  * @param bool $maxInclusive true if value that are equal to the max boundary are accepted
  */
 public function addConditionRange($attributeName, $minValue, $maxValue, $minInclusive = true, $maxInclusive = true)
 {
     $filter = $minValue . ',' . $maxValue;
     $filter = ($minInclusive ? '[' : '(') . $filter;
     $filter = $filter . ($maxInclusive ? ']' : ')');
     Utils::addPairToUniqueArray($this->conditions, $attributeName, $filter);
 }
コード例 #6
0
ファイル: Param.php プロジェクト: onigoetz/prediggo-php
 /**
  * Adds an item to the list.
  * @param integer $profileMapId The profile identifier of this item
  * @param string $itemId The item identifier
  */
 public function addBasketItem($profileMapId, $itemId)
 {
     Utils::addPairToUniqueArray($this->basketItems, $profileMapId, $itemId);
 }