Example #1
0
 /**
  * @return array|null
  */
 public function asArray()
 {
     $tagsResult = new Shopgate_Model_Abstract();
     $tagsResult->setData('uid', $this->getUid());
     $tagsResult->setData('tag', $this->getValue());
     return $tagsResult->getData();
 }
 /**
  * @return array|null
  */
 public function asArray()
 {
     $shippingResult = new Shopgate_Model_Abstract();
     $shippingResult->setData('costs_per_order', $this->getCostsPerOrder());
     $shippingResult->setData('additional_costs_per_unit', $this->getAdditionalCostsPerUnit());
     $shippingResult->setData('is_free', (int) $this->getIsFree());
     return $shippingResult->getData();
 }
Example #3
0
 /**
  * @return array|null
  */
 public function asArray()
 {
     $identifiersResult = new Shopgate_Model_Abstract();
     $identifiersResult->setData('uid', $this->getUid());
     $identifiersResult->setData('value', $this->getValue());
     $identifiersResult->setData('type', $this->getType());
     return $identifiersResult->getData();
 }
Example #4
0
 /**
  * @return array|null
  */
 public function asArray()
 {
     $manufacturerResult = new Shopgate_Model_Abstract();
     $manufacturerResult->setData('uid', $this->getUid());
     $manufacturerResult->setData('title', $this->getTitle());
     $manufacturerResult->setData('item_number', $this->getItemNumber());
     return $manufacturerResult->getData();
 }
Example #5
0
 /**
  * @return array|null
  */
 public function asArray()
 {
     $propertyResult = new Shopgate_Model_Abstract();
     $propertyResult->setData('uid', $this->getUid());
     $propertyResult->setData('label', $this->getLabel());
     $propertyResult->setData('value', $this->getValue());
     return $propertyResult->getData();
 }
Example #6
0
 /**
  * @return array|null
  */
 public function asArray()
 {
     $stockResult = new Shopgate_Model_Abstract();
     $stockResult->setData('is_saleable', (int) $this->getIsSaleable());
     $stockResult->setData('backorders', $this->getBackorders());
     $stockResult->setData('use_stock', (int) $this->getUseStock());
     $stockResult->setData('stock_quantity', $this->getStockQuantity());
     $stockResult->setData('minimum_order_quantity', $this->getMinimumOrderQuantity());
     $stockResult->setData('maximum_order_quantity', $this->getMaximumOrderQuantity());
     $stockResult->setData('availability_text', $this->getAvailabilityText());
     return $stockResult->getData();
 }
Example #7
0
 /**
  * @return array|null
  */
 public function asArray()
 {
     $reviewNode = new Shopgate_Model_Abstract();
     $reviewNode->setData('uid', $this->getUid());
     $reviewNode->setData('item_uid', $this->getItemUid());
     $reviewNode->setData('score', $this->getScore());
     $reviewNode->setData('reviewer_name', $this->getReviewerName());
     $reviewNode->setData('date', $this->getDate());
     $reviewNode->setData('title', $this->getTitle());
     $reviewNode->setData('text', $this->getText());
     return $reviewNode->getData();
 }
 /**
  * @return array|null
  */
 public function asArray()
 {
     $categoryResult = new Shopgate_Model_Abstract();
     $categoryResult->setData('uid', $this->getUid());
     $categoryResult->setData('sort_order', $this->getSortOrder());
     $categoryResult->setData('parent_uid', $this->getParentUid());
     $categoryResult->setData('is_active', $this->getIsActive());
     $categoryResult->setData('is_anchor', $this->getIsAnchor());
     $categoryResult->setData('name', $this->getName());
     $categoryResult->setData('deeplink', $this->getDeeplink());
     $categoryResult->setData('image', $this->getImage()->asArray());
     return $categoryResult->getData();
 }
Example #9
0
 /**
  * add category path
  *
  * @param int    $level
  * @param string $path
  */
 public function addItem($level, $path)
 {
     $items = $this->getItems();
     $item = new Shopgate_Model_Abstract();
     $item->setData('level', $level);
     $item->setData('path', $path);
     array_push($items, $item);
     $this->setItems($items);
 }
Example #10
0
 /**
  * @param Shopgate_Model_Abstract $parentItem
  * @param Shopgate_Model_Abstract $childItem
  */
 protected function cleanChildData($parentItem, $childItem)
 {
     foreach ($childItem->getData() as $childKey => $childValue) {
         if (is_array($childValue) || $childValue instanceof Shopgate_Model_Abstract) {
             /**
              * array or object
              */
             if (is_array($childValue) && count($childValue) > 0) {
                 /**
                  * array
                  */
                 if ($childValue == $parentItem->getData($childKey)) {
                     $childItem->setData($childKey, array());
                 }
             } elseif ($childValue instanceof Shopgate_Model_Abstract) {
                 /**
                  * object - but we check only data array
                  */
                 $parentAttribute = $parentItem->getData($childKey);
                 if ($parentAttribute instanceof Shopgate_Model_Abstract && $childValue->getData() == $parentAttribute->getData()) {
                     $childItem->setData($childKey, new Shopgate_Model_Catalog_XmlEmptyObject());
                 }
             }
         } else {
             /**
              * string
              */
             if ($childValue == $parentItem->getData($childKey)) {
                 $childItem->setData($childKey, null);
             }
         }
     }
 }