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


PHP Tx_Solr_Util::isLocalizedRecord方法代码示例

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


在下文中一共展示了Tx_Solr_Util::isLocalizedRecord方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processDatamap_afterDatabaseOperations

 /**
  * Hooks into TCE Main and watches all record creations and updates. If it
  * detects that the new/updated record belongs to a table configured for
  * indexing through Solr, we add the record to the index queue.
  *
  * @param string $status Status of the current operation, 'new' or 'update'
  * @param string $table The table the record belongs to
  * @param mixed $uid The record's uid, [integer] or [string] (like 'NEW...')
  * @param array $fields The record's data
  * @param DataHandler $tceMain TYPO3 Core Engine parent object
  * @return void
  */
 public function processDatamap_afterDatabaseOperations($status, $table, $uid, array $fields, DataHandler $tceMain)
 {
     $recordTable = $table;
     $recordUid = $uid;
     $recordPageId = 0;
     if ($status == 'new') {
         $recordUid = $tceMain->substNEWwithIDs[$recordUid];
     }
     if (Tx_Solr_Util::isDraftRecord($table, $recordUid)) {
         // skip workspaces: index only LIVE workspace
         return;
     }
     if ($status == 'update' && !isset($fields['pid'])) {
         $recordPageId = $tceMain->getPID($recordTable, $recordUid);
     } else {
         $recordPageId = $fields['pid'];
     }
     // when a content element changes we need to updated the page instead
     if ($recordTable == 'tt_content') {
         $recordTable = 'pages';
         $recordUid = $recordPageId;
     }
     $this->solrConfiguration = Tx_Solr_Util::getSolrConfigurationFromPageId($recordPageId);
     $monitoredTables = $this->getMonitoredTables($recordPageId);
     if (in_array($recordTable, $monitoredTables, TRUE)) {
         $record = $this->getRecord($recordTable, $recordUid);
         if (!empty($record)) {
             // only update/insert the item if we actually found a record
             if (Tx_Solr_Util::isLocalizedRecord($recordTable, $record)) {
                 // if it's a localization overlay, update the original record instead
                 $recordUid = $record[$GLOBALS['TCA'][$recordTable]['ctrl']['transOrigPointerField']];
                 if ($recordTable == 'pages_language_overlay') {
                     $recordTable = 'pages';
                 }
                 $tableEnableFields = implode(', ', $GLOBALS['TCA'][$recordTable]['ctrl']['enablecolumns']);
                 $l10nParentRecord = BackendUtility::getRecord($recordTable, $recordUid, $tableEnableFields, '', FALSE);
                 if (!$this->isEnabledRecord($recordTable, $l10nParentRecord)) {
                     // the l10n parent record must be visible to have it's translation indexed
                     return;
                 }
             }
             if ($this->isEnabledRecord($recordTable, $record)) {
                 $configurationName = NULL;
                 if ($recordTable !== 'pages') {
                     $configurationName = $this->getIndexingConfigurationName($table, $uid);
                 }
                 $this->indexQueue->updateItem($recordTable, $recordUid, $configurationName);
             }
             if ($recordTable == 'pages') {
                 $this->updateCanonicalPages($recordUid);
                 $this->updateMountPages($recordUid);
             }
         } else {
             // TODO move this part to the garbage collector
             // check if the item should be removed from the index because it no longer matches the conditions
             if ($this->indexQueue->containsItem($recordTable, $recordUid)) {
                 $this->removeFromIndexAndQueue($recordTable, $recordUid);
             }
         }
     }
 }
开发者ID:romaincanon,项目名称:ext-solr,代码行数:73,代码来源:RecordMonitor.php


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