当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Catalog_Model_Category::getData方法代码示例

本文整理汇总了PHP中Mage_Catalog_Model_Category::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Model_Category::getData方法的具体用法?PHP Mage_Catalog_Model_Category::getData怎么用?PHP Mage_Catalog_Model_Category::getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Catalog_Model_Category的用法示例。


在下文中一共展示了Mage_Catalog_Model_Category::getData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getFotoliaCategoryParams

 public function getFotoliaCategoryParams(Mage_Catalog_Model_Category $category)
 {
     $this->_fotoliaCategory1Id = $category->getFotoliaCategory1Id();
     $this->_fotoliaCategory2Id = $category->getFotoliaCategory2Id();
     $this->_fotoliaSearchQuery = $category->getFotoliaSearchQuery();
     $this->_fotoliaContentType = Mage::getSingleton('eav/config')->getAttribute('catalog_category', 'fotolia_content_type')->getSource()->getOptionText($category->getData('fotolia_content_type'));
     $this->_fotoliaWithPeople = Mage::getSingleton('eav/config')->getAttribute('catalog_category', 'fotolia_with_people')->getSource()->getOptionText($category->getData('fotolia_with_people'));
     $this->_fotoliaOrientation = Mage::getSingleton('eav/config')->getAttribute('catalog_category', 'fotolia_orientation')->getSource()->getOptionText($category->getData('fotolia_orientation'));
     $this->_fotoliaIsolated = Mage::getSingleton('eav/config')->getAttribute('catalog_category', 'fotolia_isolated')->getSource()->getOptionText($category->getData('fotolia_isolated'));
     $this->_fotoliaColors = $category->getFotoliaColors();
     $this->_fotoliaGalleryId = false;
     //todo
     $this->_fotoliaIdsList = $category->getFotoliaIdsList();
 }
开发者ID:mkutyba,项目名称:sample-magento-code,代码行数:14,代码来源:Mediadata.php

示例2: testSaveAction

 /**
  * @magentoDataFixture Mage/Core/_files/store.php
  * @magentoDbIsolation enabled
  * @dataProvider saveActionDataProvider
  * @param array $inputData
  * @param array $defaultAttributes
  * @param array $attributesSaved
  */
 public function testSaveAction($inputData, $defaultAttributes, $attributesSaved = array())
 {
     $store = new Mage_Core_Model_Store();
     $store->load('fixturestore', 'code');
     $storeId = $store->getId();
     $this->getRequest()->setPost($inputData);
     $this->getRequest()->setParam('store', $storeId);
     $this->getRequest()->setParam('id', 2);
     $this->dispatch('backend/admin/catalog_category/save');
     $messages = Mage::getSingleton('Mage_Backend_Model_Session')->getMessages(false)->getItemsByType(Mage_Core_Model_Message::SUCCESS);
     $this->assertNotEmpty($messages, "Could not save category");
     $this->assertEquals('The category has been saved.', current($messages)->getCode());
     $category = new Mage_Catalog_Model_Category();
     $category->setStoreId($storeId);
     $category->load(2);
     $errors = array();
     foreach ($attributesSaved as $attribute => $value) {
         $actualValue = $category->getData($attribute);
         if ($value !== $actualValue) {
             $errors[] = "value for '{$attribute}' attribute must be '{$value}', but '{$actualValue}' is found instead";
         }
     }
     foreach ($defaultAttributes as $attribute => $exists) {
         if ($exists !== $category->getExistsStoreValueFlag($attribute)) {
             if ($exists) {
                 $errors[] = "custom value for '{$attribute}' attribute is not found";
             } else {
                 $errors[] = "custom value for '{$attribute}' attribute is found, but default one must be used";
             }
         }
     }
     $this->assertEmpty($errors, "\n" . join("\n", $errors));
 }
开发者ID:nemphys,项目名称:magento2,代码行数:41,代码来源:CategoryControllerTest.php

示例3: getCategoryUrl

 /**
  * Retrieve category url
  *
  * @param   Mage_Catalog_Model_Category $category
  * @return  string
  */
 public function getCategoryUrl($category)
 {
     if ($category instanceof Mage_Catalog_Model_Category) {
         return $category->getUrl();
     }
     return Mage::getModel('catalog/category')->setData($category->getData())->getUrl();
 }
开发者ID:HelioFreitas,项目名称:magento-pt_br,代码行数:13,代码来源:Category.php

示例4: _hasCustomUpdate

 protected function _hasCustomUpdate(Mage_Catalog_Model_Category $category)
 {
     if ($category->getData('custom_layout_update') && in_array($category->getCustomDesignApply(), array(Mage_Catalog_Model_Design::CATEGORY_APPLY_CATEGORY_AND_PRODUCT_RECURSIVE, Mage_Catalog_Model_Design::CATEGORY_APPLY_CATEGORY_RECURSIVE))) {
         return true;
     }
     return false;
 }
开发者ID:novalis111,项目名称:Magento-Recursive-Layout-Updates,代码行数:7,代码来源:Category.php

示例5: getCategoryUrl

 /**
  * Get url for category data
  *
  * @param Mage_Catalog_Model_Category $category
  * @return string
  */
 public function getCategoryUrl($category)
 {
     if ($category instanceof Mage_Catalog_Model_Category) {
         $url = $category->getUrl();
     } else {
         $url = $this->_getCategoryInstance()->setData($category->getData())->getUrl();
     }
     return $url;
 }
开发者ID:albertobraschi,项目名称:NFS,代码行数:15,代码来源:Navigation.php

示例6: _isCategoryClickAble

 /**
  * Check if click able enabled for category.
  *
  * @param Varien_Data_Tree_Node|Mage_Catalog_Model_Category $category
  * @return bool
  */
 protected function _isCategoryClickAble($category)
 {
     $isCategoryClickAbleStatus = true;
     $isCategoryClickAble = $category->getData(Monsoon_Test_Helper_Data::IS_CLICK_ABLE_LINK_CODE);
     if ($isCategoryClickAble !== null && (bool) $isCategoryClickAble === false) {
         $isCategoryClickAbleStatus = false;
     }
     return $isCategoryClickAbleStatus;
 }
开发者ID:sergiozt,项目名称:monsoon,代码行数:15,代码来源:Observer.php

示例7: getCategoryUrl

 /**
  * Retrieve Url for specified category
  *
  * @param Mage_Catalog_Model_Category $category
  * @return string
  */
 public function getCategoryUrl(Mage_Catalog_Model_Category $category)
 {
     $url = $category->getData('url');
     if (null !== $url) {
         return $url;
     }
     Varien_Profiler::start('REWRITE: ' . __METHOD__);
     if ($category->hasData('request_path') && $category->getData('request_path') != '') {
         $category->setData('url', $this->_getDirectUrl($category));
         Varien_Profiler::stop('REWRITE: ' . __METHOD__);
         return $category->getData('url');
     }
     $requestPath = $this->_getRequestPath($category);
     if ($requestPath) {
         $category->setRequestPath($requestPath);
         $category->setData('url', $this->_getDirectUrl($category));
         Varien_Profiler::stop('REWRITE: ' . __METHOD__);
         return $category->getData('url');
     }
     Varien_Profiler::stop('REWRITE: ' . __METHOD__);
     $category->setData('url', $category->getCategoryIdUrl());
     return $category->getData('url');
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:29,代码来源:Url.php

示例8: beforeSave

 /**
  * Format url_key value
  *
  * @param Mage_Catalog_Model_Category $object
  * @return Mage_Catalog_Model_Category_Attribute_Backend_Urlkey
  */
 public function beforeSave($object)
 {
     $attributeName = $this->getAttribute()->getName();
     $urlKey = $object->getData($attributeName);
     if ($urlKey === false) {
         return $this;
     }
     if ($urlKey == '') {
         $urlKey = $object->getName();
     }
     if (empty($urlKey)) {
         $urlKey = Mage::helper('core')->uniqHash();
     }
     $object->setData($attributeName, $object->formatUrlKey($urlKey));
     $this->_validateEntityUrl($object);
     return $this;
 }
开发者ID:aaronleslie,项目名称:aaronunix,代码行数:23,代码来源:Urlkey.php

示例9: afterLoad

 /**
  * Unserializes the virtual category configuration after it has been loaded.
  *
  * @param Mage_Catalog_Model_Category $object Category saved.
  *
  * @return Smile_VirtualCategories_Model_Category_Attributes_Backend_Virtual
  */
 public function afterLoad($object)
 {
     $attributeCode = $this->getAttribute()->getName();
     $data = $object->getData($attributeCode);
     if ($data && is_string($data) && strlen($data)) {
         $data = unserialize($data);
     } else {
         $data = $this->_defaultValue;
     }
     $virtualCategoryRule = Mage::getModel('smile_virtualcategories/rule');
     if (isset($data['rule_serialized'])) {
         $virtualCategoryRule->getConditions()->setConditions(array())->loadArray($data['rule_serialized']);
     }
     $virtualCategoryRule->setCategory($object);
     $object->setData('is_virtual', $data['is_virtual']);
     $object->setData('virtual_rule', $virtualCategoryRule);
     return $this;
 }
开发者ID:ngocdb,项目名称:smile-magento-elasticsearch,代码行数:25,代码来源:Virtual.php

示例10: beforeSave

 /**
  * @param Mage_Catalog_Model_Category $object
  * @return $this|Convenient_CategoryCode_Model_Attribute_Backend_Code
  *
  * @author Luke Rodgers <lukerodgers90@gmail.com>
  */
 public function beforeSave($object)
 {
     $attributeName = $this->getAttribute()->getName();
     $code = $object->getData($attributeName);
     if ($code === false) {
         return $this;
     }
     if ($code == '') {
         $code = array();
         $parents = $object->getParentCategories();
         foreach ($parents as $parent) {
             if ($parent->getLevel() > 1 && $parent->getId() != $object->getId()) {
                 $code[] = $parent->getName();
             }
         }
         $code[] = $object->getName();
         $code = implode('-', $code);
     }
     $object->setData($attributeName, $object->formatUrlKey($code));
     return $this;
 }
开发者ID:asif-ali,项目名称:CategoryCode,代码行数:27,代码来源:Code.php

示例11: getCategoryUrl

 /**
  * Get url for category data
  *
  * @param Mage_Catalog_Model_Category $category
  * @return string
  */
 public function getCategoryUrl($category)
 {
     if ($category instanceof Mage_Catalog_Model_Category) {
         $url = $category->getUrl();
     } else {
         $url = $this->_getCategoryInstance()->setData($category->getData())->getUrl();
     }
     return Mage::getModel('core/url')->sessionUrlVar($url);
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:15,代码来源:Navigation.php

示例12: _prepareDataForAllFields

 /**
  * Prepare array of category data to insert or update.
  *
  * array(
  *  'field_name' => 'value'
  * )
  *
  * @param Mage_Catalog_Model_Category $category
  * @param array $replaceFields
  * @return array
  */
 protected function _prepareDataForAllFields($category, $replaceFields = array())
 {
     $table = $this->_getReadAdapter()->describeTable($this->getMainStoreTable($category->getStoreId()));
     $data = array();
     foreach ($table as $column => $columnData) {
         if (null !== $category->getData($column)) {
             if (key_exists($column, $replaceFields)) {
                 $value = $category->getData($replaceFields[$column]);
             } else {
                 $value = $category->getData($column);
             }
             if (is_array($value)) {
                 $value = implode(',', $value);
             }
             $data[$column] = $value;
         }
     }
     return $data;
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:30,代码来源:Resource_Eav_Mysql4_Category_Flat.php

示例13: getObject

 public function getObject(Mage_Catalog_Model_Category $category)
 {
     /** @var $productCollection Mage_Catalog_Model_Resource_Product_Collection */
     $productCollection = $category->getProductCollection();
     $category->setProductCount($productCollection->addMinimalPrice()->count());
     $transport = new Varien_Object();
     Mage::dispatchEvent('algolia_category_index_before', array('category' => $category, 'custom_data' => $transport));
     $customData = $transport->getData();
     $storeId = $category->getStoreId();
     $category->getUrlInstance()->setStore($storeId);
     $path = '';
     foreach ($category->getPathIds() as $categoryId) {
         if ($path != '') {
             $path .= ' / ';
         }
         $path .= $this->getCategoryName($categoryId, $storeId);
     }
     $image_url = NULL;
     try {
         $image_url = $category->getImageUrl();
     } catch (Exception $e) {
         /* no image, no default: not fatal */
     }
     $data = array('objectID' => $category->getId(), 'name' => $category->getName(), 'path' => $path, 'level' => $category->getLevel(), 'url' => $category->getUrl(), '_tags' => array('category'), 'popularity' => 1, 'product_count' => $category->getProductCount());
     if (!empty($image_url)) {
         $data['image_url'] = $image_url;
     }
     foreach ($this->config->getCategoryAdditionalAttributes($storeId) as $attribute) {
         $value = $category->getData($attribute['attribute']);
         $attribute_ressource = $category->getResource()->getAttribute($attribute['attribute']);
         if ($attribute_ressource) {
             $value = $attribute_ressource->getFrontend()->getValue($category);
         }
         if (isset($data[$attribute['attribute']])) {
             $value = $data[$attribute['attribute']];
         }
         if ($value) {
             $data[$attribute['attribute']] = $value;
         }
     }
     $data = array_merge($data, $customData);
     foreach ($data as &$data0) {
         $data0 = $this->try_cast($data0);
     }
     return $data;
 }
开发者ID:halk,项目名称:algoliasearch-magento,代码行数:46,代码来源:Categoryhelper.php

示例14: getAllCategoryIdsFromCategory

 /**
  * @param Mage_Catalog_Model_Category $category
  * @return array
  */
 public function getAllCategoryIdsFromCategory(Mage_Catalog_Model_Category $category = null)
 {
     if (empty($category)) {
         return array();
     }
     $_pathIds = $category->getData("path");
     return explode("/", $_pathIds);
 }
开发者ID:sereban,项目名称:magento-marketo-integration,代码行数:12,代码来源:Data.php

示例15: getCategoryUrl

 /**
  * Retrieve category url
  *
  * @param   Mage_Catalog_Model_Category $category
  * @return  string
  */
 public function getCategoryUrl($category)
 {
     return Mage::getModel('catalog/category')->setData($category->getData())->getCategoryUrl();
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:10,代码来源:Category.php


注:本文中的Mage_Catalog_Model_Category::getData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。