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


PHP Util::getRootPageId方法代碼示例

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


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

示例1: getSiteByPageId

 /**
  * Gets the Site for a specific page Id.
  *
  * @param integer $pageId The page Id to get a Site object for.
  * @return Site Site for the given page Id.
  */
 public static function getSiteByPageId($pageId)
 {
     $rootPageId = Util::getRootPageId($pageId);
     if (!isset(self::$sitesCache[$rootPageId])) {
         self::$sitesCache[$rootPageId] = GeneralUtility::makeInstance(__CLASS__, $rootPageId);
     }
     return self::$sitesCache[$rootPageId];
 }
開發者ID:kalypso63,項目名稱:ext-solr,代碼行數:14,代碼來源:Site.php

示例2: addItem

 /**
  * Adds an item to the index queue.
  *
  * Not meant for public use.
  *
  * @param string $itemType The item's type, usually a table name.
  * @param string $itemUid The item's uid, usually an integer uid, could be a
  *      different value for non-database-record types.
  * @param string $indexingConfiguration The item's indexing configuration to use.
  *      Optional, overwrites existing / determined configuration.
  * @return void
  */
 private function addItem($itemType, $itemUid, $indexingConfiguration)
 {
     $additionalRecordFields = '';
     if ($itemType == 'pages') {
         $additionalRecordFields = ', doktype, uid';
     }
     $record = BackendUtility::getRecord($itemType, $itemUid, 'pid' . $additionalRecordFields);
     if (empty($record) || $itemType == 'pages' && !Util::isAllowedPageType($record)) {
         return;
     }
     if ($itemType == 'pages') {
         $rootPageId = Util::getRootPageId($itemUid);
     } else {
         $rootPageId = Util::getRootPageId($record['pid']);
     }
     if (Util::isRootPage($rootPageId)) {
         $item = array('root' => $rootPageId, 'item_type' => $itemType, 'item_uid' => $itemUid, 'changed' => $this->getItemChangedTime($itemType, $itemUid));
         if (!empty($indexingConfiguration)) {
             $indexingConfigurationList = array($indexingConfiguration);
         } else {
             $indexingConfigurationList = $this->getIndexingConfigurationsByItem($itemType, $itemUid, $rootPageId);
         }
         $solrConfiguration = Util::getSolrConfigurationFromPageId($rootPageId);
         // make a backup of the current item
         $baseItem = $item;
         foreach ($indexingConfigurationList as $indexingConfigurationCurrent) {
             $item = $baseItem;
             $item['indexing_configuration'] = $indexingConfigurationCurrent;
             $addItemToQueue = TRUE;
             // Ensure additionalWhereClause is applied.
             if (!empty($solrConfiguration['index.']['queue.'][$item['indexing_configuration'] . '.']['additionalWhereClause'])) {
                 $indexingConfigurationCheckRecord = BackendUtility::getRecord($itemType, $itemUid, 'pid' . $additionalRecordFields, ' AND ' . $solrConfiguration['index.']['queue.'][$item['indexing_configuration'] . '.']['additionalWhereClause']);
                 if (empty($indexingConfigurationCheckRecord)) {
                     // item does not match the indexing configuration's additionalWhereClause
                     $addItemToQueue = FALSE;
                 }
             }
             if ($addItemToQueue) {
                 $GLOBALS['TYPO3_DB']->exec_INSERTquery('tx_solr_indexqueue_item', $item);
             }
         }
     }
 }
開發者ID:nxpthx,項目名稱:ext-solr,代碼行數:55,代碼來源:Queue.php


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