/**
  * This function returns the parameter as string.
  *
  * @author David Pauli <*****@*****.**>
  * @since 0.0.0
  * @since 0.1.0 Use a default Locale and Currency.
  * @api
  * @return String The parameter build with this product filter.
  */
 private function getParameter()
 {
     $parameter = array();
     array_push($parameter, "locale=" . Locales::getLocale());
     array_push($parameter, "currency=" . Currencies::getCurrency());
     if (!InputValidator::isEmpty($this->page)) {
         array_push($parameter, "page=" . $this->page);
     }
     if (!InputValidator::isEmpty($this->resultsPerPage)) {
         array_push($parameter, "resultsPerPage=" . $this->resultsPerPage);
     }
     if (!InputValidator::isEmpty($this->direction)) {
         array_push($parameter, "direction=" . $this->direction);
     }
     if (!InputValidator::isEmpty($this->sort)) {
         array_push($parameter, "sort=" . $this->sort);
     }
     if (!InputValidator::isEmpty($this->q)) {
         array_push($parameter, "q=" . $this->q);
     }
     if (!InputValidator::isEmpty($this->categoryID)) {
         array_push($parameter, "categoryId=" . $this->categoryID);
     }
     foreach ($this->IDs as $number => $id) {
         array_push($parameter, "id=" . $id);
     }
     return implode("&", $parameter);
 }
Beispiel #2
0
 /**
  * Returns configured Currency.
  *
  * @author David Pauli <*****@*****.**>
  * @return String|null The Currency which is configured for REST calls.
  * @since 0.1.0
  * @since 0.1.2 Add error reporting.
  */
 public function getUsedCurrency()
 {
     self::errorReset();
     return Currencies::getCurrency();
 }
Beispiel #3
0
 /**
  * Returns configured Currency.
  *
  * @api
  * @author David Pauli <*****@*****.**>
  * @since 0.1.0
  * @return String|null The Currency which is configured for REST calls.
  */
 public function getCurrency()
 {
     return Currencies::getCurrency();
 }
 /**
  * This function returns the parameter as string.
  *
  * @author David Pauli <*****@*****.**>
  * @return String The parameter build with this order filter.
  * @since 0.1.3
  * @since 0.2.1 Update build of parameter
  */
 private function getParameter()
 {
     $parameter = array();
     array_push($parameter, "locale=" . Locales::getLocale());
     array_push($parameter, "currency=" . Currencies::getCurrency());
     if (!InputValidator::isEmpty($this->createdAfterDate)) {
         array_push($parameter, "createdAfter=" . $this->createdAfterDate->asReadable());
     }
     if (!InputValidator::isEmpty($this->createdBeforeDate)) {
         array_push($parameter, "createdBefore=" . $this->createdBeforeDate->asReadable());
     }
     if (!InputValidator::isEmpty($this->customerId)) {
         array_push($parameter, "customerId=" . $this->customerId);
     }
     if (!InputValidator::isEmpty($this->isArchived)) {
         array_push($parameter, "archivedOn=" . $this->isArchived);
     }
     if (!InputValidator::isEmpty($this->isClosed)) {
         array_push($parameter, "closedOn=" . $this->isClosed);
     }
     if (!InputValidator::isEmpty($this->isDelivered)) {
         array_push($parameter, "deliveredOn=" . $this->isDelivered);
     }
     if (!InputValidator::isEmpty($this->isDispatched)) {
         array_push($parameter, "dispatchedOn=" . $this->isDispatched);
     }
     if (!InputValidator::isEmpty($this->isInvoiced)) {
         array_push($parameter, "invoicedOn=" . $this->isInvoiced);
     }
     if (!InputValidator::isEmpty($this->isPaid)) {
         array_push($parameter, "paidOn=" . $this->isPaid);
     }
     if (!InputValidator::isEmpty($this->isPending)) {
         array_push($parameter, "pendingOn=" . $this->isPending);
     }
     if (!InputValidator::isEmpty($this->isRejected)) {
         array_push($parameter, "rejectedOn=" . $this->isRejected);
     }
     if (!InputValidator::isEmpty($this->isReturned)) {
         array_push($parameter, "returnedOn=" . $this->isReturned);
     }
     if (!InputValidator::isEmpty($this->isViewed)) {
         array_push($parameter, "viewedOn=" . $this->isViewed);
     }
     if (!InputValidator::isEmpty($this->updatedFromDate)) {
         array_push($parameter, "updatedFrom=" . $this->updatedFromDate->asReadable());
     }
     if (!InputValidator::isEmpty($this->page)) {
         array_push($parameter, "page=" . $this->page);
     }
     if (!InputValidator::isEmpty($this->productId)) {
         array_push($parameter, "productId=" . $this->productId);
     }
     if (!InputValidator::isEmpty($this->resultsPerPage)) {
         array_push($parameter, "resultsPerPage=" . $this->resultsPerPage);
     }
     if (!InputValidator::isEmpty($this->sortLastUpdate)) {
         array_push($parameter, "sortLastUpdate=" . $this->sortLastUpdate);
     }
     return implode("&", $parameter);
 }