/** * Get the default constraint for the queries * * @param QueryInterface $query * * @return array */ protected function getDefaultConstraints(QueryInterface $query) { $constraints = []; $constraints[] = $query->in('uniqueRegisterKey', $this->indexTypes); $storagePages = $this->getStoragePageIds(); if (!empty($storagePages)) { $constraints[] = $query->in('pid', $storagePages); } $arguments = ['indexIds' => [], 'indexTypes' => $this->indexTypes, 'contentRecord' => $this->contentRecord]; $signalSlotDispatcher = HelperUtility::getSignalSlotDispatcher(); $arguments = $signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__, $arguments); if ($arguments['indexIds']) { $constraints[] = $query->in('foreign_uid', $arguments['indexIds']); } return $constraints; }
/** * Get the default constraint for the queries * * @param QueryInterface $query * * @return array */ protected function getDefaultConstraints(QueryInterface $query) { $constraints = array(); $constraints[] = $query->in('uniqueRegisterKey', $this->indexTypes); // storage page selection // @todo please check core API functions again /** @var ConfigurationManagerInterface $configuratioManager */ $configurationManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface'); $frameworkConfiguration = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); $storagePages = isset($frameworkConfiguration['persistence']['storagePid']) ? GeneralUtility::intExplode(',', $frameworkConfiguration['persistence']['storagePid']) : array(); if (!empty($storagePages)) { $constraints[] = $query->in('pid', $storagePages); } $arguments = array('indexIds' => array(), 'indexTypes' => $this->indexTypes, 'contentRecord' => $this->contentRecord); $signalSlotDispatcher = HelperUtility::getSignalSlotDispatcher(); $arguments = $signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__, $arguments); if ($arguments['indexIds']) { $constraints[] = $query->in('foreign_uid', $arguments['indexIds']); } return $constraints; }