Beispiel #1
0
 /**
  * set term
  *
  * @param string
  * @return this
  */
 public function setTerm($term)
 {
     //Argument 1 must be a string
     Eden_Zappos_Error::i()->argument(1, 'string');
     $this->_term = $term;
     return $this;
 }
Beispiel #2
0
 /**
  * set values id
  *
  * @param string|int
  * @return this
  */
 public function setValuesId($values)
 {
     //Argument 1 must be a string or int
     Eden_Zappos_Error::i()->argument(1, 'string', 'int');
     $this->_values = $values;
     return $this;
 }
Beispiel #3
0
 protected function _getResponse($method, array $query = array())
 {
     //Argument 1 must be a string
     Eden_Zappos_Error::i()->argument(1, 'string');
     //Our request parameters
     $default = array(self::KEY => $this->_apiKey);
     //generate URL-encoded query string to build our NVP string
     $query = http_build_query($query + $default);
     $curl = Eden_Curl::i()->setUrl($method . '?' . $query)->setReturnTransfer(TRUE)->setHeader(false);
     $results = $curl->getQueryResponse();
     foreach ($results as $key => $value) {
         if (!is_array($value)) {
             return $value;
         }
         if (!empty($value) && isset($value)) {
             foreach ($value as $k => $v) {
                 $response = json_decode($k . ']}', false);
                 if (empty($response)) {
                     $response = json_decode($k, false);
                 }
                 break;
             }
         } else {
             return $key;
         }
     }
     return $response;
 }
Beispiel #4
0
 /**
  * set brand id
  *
  * @param string|int
  * @return this
  */
 public function setBrandId($brandId)
 {
     //Argument 1 must be a string or int
     Eden_Zappos_Error::i()->argument(1, 'string', 'int');
     $this->_brandId = $brandId;
     return $this;
 }
Beispiel #5
0
 /**
  * Set sizing transformation for an image
  *
  * @param string
  * @return this
  */
 public function setImageRecipe($imageRecipe)
 {
     //Argument 1 must be a string
     Eden_Zappos_Error::i()->argument(1, 'string');
     $this->_imageRecipe = '["' . $imageRecipe . '"]';
     return $this;
 }
Beispiel #6
0
 /**
  * filter results with distinct expression
  *
  * @param string
  * @param string
  * @return this
  */
 public function filterProduct($facetFields, $facetValue)
 {
     Eden_Zappos_Error::i()->argument(1, 'string')->argument(2, 'string');
     //Argument 2 must be a string
     $this->_filter = '{".' . $facetFields . '.":[".' . $facetValue . '."]}';
     return $this;
 }
Beispiel #7
0
 /**
  * filter by state location
  *
  * @param string
  * @return this
  */
 public function setStateLocation($locationValue)
 {
     //Argument 1 must be a string
     Eden_Zappos_Error::i()->argument(1, 'string');
     $this->_location = '{"state":"' . $locationValue . '"}';
     return $this;
 }
Beispiel #8
0
 /**
  * set start Date
  *
  * @param string|int
  * @return this
  */
 public function setStartDate($startDate)
 {
     //Argument 1 must be a string or int
     Eden_Zappos_Error::i()->argument(1, 'string', 'int');
     $this->_startDate = $startDate;
     return $this;
 }
Beispiel #9
0
 /**
  * Include specific style in the results
  *
  * @param string
  * @return this
  */
 public function includeSpecific($style)
 {
     //Argument 1 must be a string
     Eden_Zappos_Error::i()->argument(1, 'string');
     $this->_style = '["' . $style . '"]';
     return $this;
 }