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


PHP Model::invalidateFrontendCache方法代碼示例

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


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

示例1: updateVideo

 /**
  * @param array $item
  * @return int
  */
 public static function updateVideo(array $item)
 {
     BackendModel::invalidateFrontendCache('productsCache');
     return (int) BackendModel::getContainer()->get('database')->update('catalog_videos', $item, 'id = ?', array($item['id']));
 }
開發者ID:Comsa-Veurne,項目名稱:modules,代碼行數:9,代碼來源:Model.php

示例2: updateCategory

 /**
  * Update a certain category
  *
  * @param array $item
  *
  * @return bool
  */
 public static function updateCategory(array $item)
 {
     return (bool) BackendModel::getContainer()->get('database')->update('galleria_categories', (array) $item, 'id = ?', array($item['id']));
     BackendModel::invalidateFrontendCache('galleria', BL::getWorkingLanguage());
 }
開發者ID:Brandberries,項目名稱:forkcms-galleria,代碼行數:12,代碼來源:Model.php

示例3: saveImage

 /**
  * @param array $item
  * @return int
  */
 public static function saveImage(array $item)
 {
     if (isset($item['id']) && self::existsImage($item['id'])) {
         self::updateImage($item);
     } else {
         $item['id'] = self::insertImage($item);
     }
     BackendModel::invalidateFrontendCache('agendaCache');
     return (int) $item['id'];
 }
開發者ID:Comsa-Veurne,項目名稱:modules,代碼行數:14,代碼來源:Model.php

示例4: updateCommentStatuses

 /**
  * Updates one or more comments' status
  *
  * @param array  $ids    The id(s) of the comment(s) to change the status for.
  * @param string $status The new status.
  */
 public static function updateCommentStatuses($ids, $status)
 {
     // make sure $ids is an array
     $ids = (array) $ids;
     // loop and cast to integers
     foreach ($ids as &$id) {
         $id = (int) $id;
     }
     // create an array with an equal amount of questionmarks as ids provided
     $idPlaceHolders = array_fill(0, count($ids), '?');
     // get the items and their languages
     $items = (array) BackendModel::getContainer()->get('database')->getPairs('SELECT i.post_id, i.language
          FROM blog_comments AS i
          WHERE i.id IN (' . implode(', ', $idPlaceHolders) . ')', $ids, 'post_id');
     // only proceed if there are items
     if (!empty($items)) {
         // get the ids
         $itemIds = array_keys($items);
         // get the unique languages
         $languages = array_unique(array_values($items));
         // update records
         BackendModel::getContainer()->get('database')->execute('UPDATE blog_comments
              SET status = ?
              WHERE id IN (' . implode(', ', $idPlaceHolders) . ')', array_merge(array((string) $status), $ids));
         // recalculate the comment count
         self::reCalculateCommentCount($itemIds);
         // invalidate the cache for blog
         foreach ($languages as $language) {
             BackendModel::invalidateFrontendCache('Blog', $language);
         }
     }
 }
開發者ID:hossine,項目名稱:forkcms,代碼行數:38,代碼來源:Model.php

示例5: updateCategory

 /**
  * Update a certain category
  *
  * @param array $item
  */
 public static function updateCategory(array $item)
 {
     // update faq category
     BackendModel::getContainer()->get('database')->update('faq_categories', $item, 'id = ?', array($item['id']));
     // update extra
     BackendModel::updateExtra($item['extra_id'], 'data', array('id' => $item['id'], 'extra_label' => 'Category: ' . $item['title'], 'language' => $item['language'], 'edit_url' => BackendModel::createURLForAction('EditCategory') . '&id=' . $item['id']));
     // invalidate faq
     BackendModel::invalidateFrontendCache('Faq', BL::getWorkingLanguage());
 }
開發者ID:newaltcoin,項目名稱:forkcms,代碼行數:14,代碼來源:Model.php


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