/** * @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(); }
/** * @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(); }
/** * @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(); }
/** * @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(); }
/** * @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(); }
/** * @return array|null */ public function asArray() { $categoryPathResult = new Shopgate_Model_Abstract(); $categoryPathResult->setData('uid', $this->getUid()); $categoryPathResult->setData('sort_order', (int) $this->getSortOrder()); $itemsData = array(); /** * @var Shopgate_Model_Abstract $item */ foreach ($this->getItems() as $item) { $itemResult = new Shopgate_Model_Abstract(); $itemResult->setData('level', $item->getData('level')); $itemResult->setData('path', $item->getData('path')); array_push($itemsData, $itemResult->getData()); } $categoryPathResult->setData('paths', $itemsData); return $categoryPathResult->getData(); }
/** * @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(); }
/** * @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); } } } }