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


PHP category::decrementPendingEntriesCount方法代码示例

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


在下文中一共展示了category::decrementPendingEntriesCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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


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