當前位置: 首頁>>代碼示例>>PHP>>正文


PHP unknown_type::getParentId方法代碼示例

本文整理匯總了PHP中unknown_type::getParentId方法的典型用法代碼示例。如果您正苦於以下問題:PHP unknown_type::getParentId方法的具體用法?PHP unknown_type::getParentId怎麽用?PHP unknown_type::getParentId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在unknown_type的用法示例。


在下文中一共展示了unknown_type::getParentId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _GetParentOfEntity

 /**
  * Для сущности со связью RELATION_TYPE_TREE возвращает предка
  *
  * @param unknown_type $oEntity
  * @return unknown
  */
 protected function _GetParentOfEntity($oEntity)
 {
     if (in_array(EntityORM::RELATION_TYPE_TREE, $oEntity->_getRelations())) {
         $aRelationsData = $oEntity->_getRelationsData();
         if (array_key_exists('parent', $aRelationsData)) {
             $oParent = $aRelationsData['parent'];
         } else {
             $oParent = '%%NULL_PARENT%%';
             if ($sPrimaryKey = $oEntity->_getPrimaryKey()) {
                 if ($sParentId = $oEntity->getParentId()) {
                     $oParent = $this->GetByFilter(array($sPrimaryKey => $sParentId), Engine::GetEntityName($oEntity));
                 }
             }
         }
         if (!is_null($oParent)) {
             $oEntity->setParent($oParent);
             return $oParent;
         }
     }
     return false;
 }
開發者ID:narush,項目名稱:livestreet,代碼行數:27,代碼來源:ModuleORM.class.php

示例2: getCategoryPath

 /**
  * Get category path
  * @param unknown_type $category
  */
 public function getCategoryPath($category, $store)
 {
     $categoryPath = str_replace('/', '_._._', $category->getName()) . '/' . $category->getId();
     while ($category->getParentId() > 0) {
         $parentCategory = $category->getParentCategory();
         $category = Mage::getModel('catalog/category')->setStoreId($store->getId())->load($parentCategory->getId());
         if (in_array($category->getId(), $this->allowCategoryIds[$store->getId()])) {
             if ($category && $category->getIsActive() && $category->getIncludeInMenu()) {
                 $categoryPath = str_replace('/', '_._._', $category->getName()) . '/' . $category->getId() . '/' . $categoryPath;
             }
         }
     }
     return trim($categoryPath, '/');
 }
開發者ID:shebin512,項目名稱:Magento_Zoff,代碼行數:18,代碼來源:Ultility0805.php

示例3: getCategoryPath

 /**
  * Get category path
  * @param unknown_type $category
  */
 public function getCategoryPath($category, $store)
 {
     $currentCategory = $category;
     $categoryPath = str_replace('/', '_._._', $category->getName()) . '/' . $category->getId();
     while ($category->getParentId() > 0) {
         $category = $category->getParentCategory();
         if (in_array($category->getId(), $this->allowCategoryIds[$store->getId()])) {
             $category->setStoreId($store->getId());
             $categoryPath = str_replace('/', '_._._', $category->getName()) . '/' . $category->getId() . '/' . $categoryPath;
         }
     }
     return trim($categoryPath, '/');
 }
開發者ID:jokusafet,項目名稱:MagentoSource,代碼行數:17,代碼來源:Ultility.php


注:本文中的unknown_type::getParentId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。