Example #1
0
 /**
  * {@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;
 }
Example #2
0
 /**
  * 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;
 }
Example #3
0
 /**
  * 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;
 }
 /**
  * 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);
 }
Example #5
0
 /**
  * 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);
 }
Example #6
0
 /**
  * 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);
 }