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


PHP category::getFullName方法代碼示例

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


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

示例1: setEntryOnCategory

 private function setEntryOnCategory(category $category, $entry = null)
 {
     $category->incrementEntriesCount($this->getEntryId());
     $category->incrementDirectEntriesCount($this->getEntryId());
     //if was pending - decrease pending entries count!
     if ($this->getColumnsOldValue(categoryEntryPeer::STATUS) == CategoryEntryStatus::PENDING) {
         $category->decrementPendingEntriesCount();
     }
     $category->save();
     //only categories with no context are saved on entry - this is only for Backward compatible
     if ($entry && !categoryEntryPeer::getSkipSave() && (trim($category->getPrivacyContexts()) == '' || $category->getPrivacyContexts() == null)) {
         $categories = array();
         if (trim($entry->getCategories()) != '') {
             $categories = explode(entry::ENTRY_CATEGORY_SEPARATOR, $entry->getCategories());
         }
         $categories[] = $category->getFullName();
         $categoriesIds = array();
         if (trim($entry->getCategoriesIds()) != '') {
             $categoriesIds = explode(entry::ENTRY_CATEGORY_SEPARATOR, $entry->getCategoriesIds());
         }
         $categoriesIds[] = $category->getId();
         $entry->parentSetCategories(implode(entry::ENTRY_CATEGORY_SEPARATOR, $categories));
         $entry->parentSetCategoriesIds(implode(entry::ENTRY_CATEGORY_SEPARATOR, $categoriesIds));
         $entry->justSave();
     }
     return $entry;
 }
開發者ID:panigh,項目名稱:server,代碼行數:27,代碼來源:categoryEntry.php

示例2: handleCoreException

 private function handleCoreException(kCoreException $ex, category $categoryDb, KalturaCategory $category)
 {
     switch ($ex->getCode()) {
         case kCoreException::DUPLICATE_CATEGORY:
             throw new KalturaAPIException(KalturaErrors::DUPLICATE_CATEGORY, $categoryDb->getFullName());
         case kCoreException::PARENT_ID_IS_CHILD:
             throw new KalturaAPIException(KalturaErrors::PARENT_CATEGORY_IS_CHILD, $category->parentId, $categoryDb->getId());
         default:
             throw $ex;
     }
 }
開發者ID:richhl,項目名稱:kalturaCE,代碼行數:11,代碼來源:CategoryService.php

示例3: getCategoryMrssXml

 /**
  * Function calculates and returns the MRSS XML of a category
  * @param category $category
  * @param SimpleXMLElement $mrss
  * @param kMrssParameters $mrssParams
  * @param string $features
  * @return SimpleXMLElement
  */
 public static function getCategoryMrssXml(category $category, SimpleXMLElement $mrss = null, kMrssParameters $mrssParams = null, $features = null)
 {
     $instanceKey = self::generateInstanceKey($category->getId(), $mrssParams, $features);
     if (is_null($mrss)) {
         $mrss = self::getInstanceFromPool($instanceKey);
         if ($mrss) {
             return $mrss;
         }
         $mrss = new SimpleXMLElement('<item/>');
     }
     if (!$features || in_array(ObjectFeatureType::METADATA, $features)) {
         $mrss->addChild("id", $category->getId());
         $mrss->addChild("name", $category->getName());
         $mrss->addChild("referenceId", $category->getReferenceId());
         $mrss->addChild("fullName", $category->getFullName());
     }
     $mrssContributors = self::getMrssContributors();
     if (count($mrssContributors)) {
         foreach ($mrssContributors as $mrssContributor) {
             /* @var $mrssContributor IKalturaMrssContributor */
             try {
                 if (!$features || in_array($mrssContributor->getObjectFeatureType(), $features)) {
                     $mrssContributor->contribute($category, $mrss, $mrssParams);
                 }
             } catch (kCoreException $ex) {
                 KalturaLog::err("Unable to add MRSS element for contributor [" . get_class($mrssContributor) . "] message [" . $ex->getMessage() . "]");
             }
         }
     }
     if ($features && in_array(ObjectFeatureType::ANCESTOR_RECURSIVE, $features)) {
         $ancestorIds = explode(">", $category->getFullIds());
         $ancestorCategories = categoryPeer::retrieveByPKs($ancestorIds);
         array_pop($ancestorCategories);
         //find and delete the ANCESTOR_RECURSIVE from the features array
         for ($i = 0; $i < count($features); $i++) {
             if ($features[$i] == ObjectFeatureType::ANCESTOR_RECURSIVE) {
                 unset($features[$i]);
             }
         }
         //retrieve mrss for each ancestor category
         $parentCategories = $mrss->addChild('parent_categories');
         foreach ($ancestorCategories as $ancestorCategory) {
             $ancestorMrss = $parentCategories->addChild('category_item');
             $ancestorMrss = self::getCategoryMrssXml($ancestorCategory, $ancestorMrss, $mrssParams, $features);
         }
     }
     if ($mrssParams && $mrssParams->getItemXpathsToExtend()) {
         self::addExtendingItemsToMrss($mrss, $mrssParams);
     }
     self::addInstanceToPool($instanceKey, $mrss);
     return $mrss;
 }
開發者ID:DBezemer,項目名稱:server,代碼行數:60,代碼來源:kMrssManager.php

示例4: setEntryOnCategory

 private function setEntryOnCategory(category $category, $entry = null)
 {
     if (is_null($this->entryCategoriesAddedIds)) {
         $categoriesEntries = categoryEntryPeer::retrieveActiveByEntryId($this->getEntryId());
         $categoriesIds = array();
         foreach ($categoriesEntries as $categroyEntry) {
             //cannot get directly the full ids - since it might not be updated.
             if ($categroyEntry->getCategoryId() != $this->getCategoryId()) {
                 $categoriesIds[] = $categroyEntry->getCategoryId();
             }
         }
         $categoriesAdded = categoryPeer::retrieveByPKs($categoriesIds);
         $entryCategoriesAddedIds = array();
         foreach ($categoriesAdded as $categoryAdded) {
             $fullIds = explode(categoryPeer::CATEGORY_SEPARATOR, $categoryAdded->getFullIds());
             $entryCategoriesAddedIds = array_merge($entryCategoriesAddedIds, $fullIds);
         }
         $this->entryCategoriesAddedIds = $entryCategoriesAddedIds;
     }
     $category->incrementEntriesCount(1, $this->entryCategoriesAddedIds);
     $category->incrementDirectEntriesCount();
     //if was pending - decrease pending entries count!
     if ($this->getColumnsOldValue(categoryEntryPeer::STATUS) == CategoryEntryStatus::PENDING) {
         $category->decrementPendingEntriesCount();
     }
     $category->save();
     //only categories with no context are saved on entry - this is only for Backward compatible
     if ($entry && !categoryEntryPeer::getSkipSave() && (trim($category->getPrivacyContexts()) == '' || $category->getPrivacyContexts() == null)) {
         $categories = array();
         if (trim($entry->getCategories()) != '') {
             $categories = explode(entry::ENTRY_CATEGORY_SEPARATOR, $entry->getCategories());
         }
         $categories[] = $category->getFullName();
         $categoriesIds = array();
         if (trim($entry->getCategoriesIds()) != '') {
             $categoriesIds = explode(entry::ENTRY_CATEGORY_SEPARATOR, $entry->getCategoriesIds());
         }
         $categoriesIds[] = $category->getId();
         $entry->parentSetCategories(implode(entry::ENTRY_CATEGORY_SEPARATOR, $categories));
         $entry->parentSetCategoriesIds(implode(entry::ENTRY_CATEGORY_SEPARATOR, $categoriesIds));
         $entry->justSave();
     }
     return $entry;
 }
開發者ID:EfncoPlugins,項目名稱:Media-Management-based-on-Kaltura,代碼行數:44,代碼來源:categoryEntry.php

示例5: handleCoreException

 private function handleCoreException(kCoreException $ex, category $categoryDb, KalturaCategory $category)
 {
     switch ($ex->getCode()) {
         case kCoreException::DUPLICATE_CATEGORY:
             throw new KalturaAPIException(KalturaErrors::DUPLICATE_CATEGORY, $categoryDb->getFullName());
         case kCoreException::PARENT_ID_IS_CHILD:
             throw new KalturaAPIException(KalturaErrors::PARENT_CATEGORY_IS_CHILD, $category->parentId, $categoryDb->getId());
         case kCoreException::DISABLE_CATEGORY_LIMIT_MULTI_PRIVACY_CONTEXT_FORBIDDEN:
             throw new KalturaAPIException(KalturaErrors::CANNOT_SET_MULTI_PRIVACY_CONTEXT);
         default:
             throw $ex;
     }
 }
開發者ID:dozernz,項目名稱:server,代碼行數:13,代碼來源:CategoryService.php


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