protected function updateOrAddItemForAllRelatedRootPages($itemType, $itemUid, $forcedChangeTime): int
    {
        $updateCount = 0;
        $rootPageIds = $this->rootPageResolver->getResponsibleRootPageIds($itemType, $itemUid);
        foreach ($rootPageIds as $rootPageId) {
            $skipInvalidRootPage = $rootPageId === 0;
            if ($skipInvalidRootPage) {
                continue;
            }

            $solrConfiguration = Util::getSolrConfigurationFromPageId($rootPageId);
            $indexingConfiguration = $this->recordService->getIndexingConfigurationName($itemType, $itemUid, $solrConfiguration);
            $itemInQueueForRootPage = $this->containsItemWithRootPageId($itemType, $itemUid, $rootPageId);
            if ($itemInQueueForRootPage) {
                // update changed time if that item is in the queue already
                $changedTime = ($forcedChangeTime > 0) ? $forcedChangeTime : $this->getItemChangedTime($itemType, $itemUid);
                $updatedRows = $this->queueItemRepository->updateExistingItemByItemTypeAndItemUidAndRootPageId($itemType, $itemUid, $rootPageId, $changedTime, $indexingConfiguration);
            } else {
                // add the item since it's not in the queue yet
                $updatedRows = $this->addNewItem($itemType, $itemUid, $indexingConfiguration, $rootPageId);
            }

            $updateCount += $updatedRows;
        }

        return $updateCount;
    }
protected function updateOrAddItemForAllRelatedRootPages($itemType, $itemUid, $forcedChangeTime): int
    {
        $updateCount = 0;
        $rootPageIds = $this->rootPageResolver->getResponsibleRootPageIds($itemType, $itemUid);
        foreach ($rootPageIds as $rootPageId) {
            $skipInvalidRootPage = $rootPageId === 0;
            if ($skipInvalidRootPage) {
                continue;
            }

            $solrConfiguration = Util::getSolrConfigurationFromPageId($rootPageId);
            $indexingConfiguration = $this->recordService->getIndexingConfigurationName($itemType, $itemUid, $solrConfiguration);
            $itemInQueueForRootPage = $this->containsItemWithRootPageId($itemType, $itemUid, $rootPageId);
            if ($itemInQueueForRootPage) {
                // update changed time if that item is in the queue already
                $changedTime = ($forcedChangeTime > 0) ? $forcedChangeTime : $this->getItemChangedTime($itemType, $itemUid);
                $updatedRows = $this->queueItemRepository->updateExistingItemByItemTypeAndItemUidAndRootPageId($itemType, $itemUid, $rootPageId, $changedTime, $indexingConfiguration);
            } else {
                // add the item since it's not in the queue yet
                $updatedRows = $this->addNewItem($itemType, $itemUid, $indexingConfiguration, $rootPageId);
            }

            $updateCount += $updatedRows;
        }

        return $updateCount;
    }
protected function updateOrAddItemForAllRelatedRootPages ( $ itemType , $ itemUid , $ forcedChangeTime ) : int { $ updateCount = 0 ; $ rootPageIds = $ this -> rootPageResolver -> getResponsibleRootPageIds ( $ itemType , $ itemUid ) ; foreach ( $ rootPageIds as $ rootPageId ) { $ skipInvalidRootPage = $ rootPageId === 0 ; if ( $ skipInvalidRootPage ) { continue ; } $ solrConfiguration = Util :: getSolrConfigurationFromPageId ( $ rootPageId ) ; $ indexingConfiguration = $ this -> recordService -> getIndexingConfigurationName ( $ itemType , $ itemUid , $ solrConfiguration ) ; $ itemInQueueForRootPage = $ this -> containsItemWithRootPageId ( $ itemType , $ itemUid , $ rootPageId ) ; if ( $ itemInQueueForRootPage ) { // update changed time if that item is in the queue already $ changedTime = ( $ forcedChangeTime > 0 ) ? $ forcedChangeTime : $ this -> getItemChangedTime ( $ itemType , $ itemUid ) ; $ updatedRows = $ this -> queueItemRepository -> updateExistingItemByItemTypeAndItemUidAndRootPageId ( $ itemType , $ itemUid , $ rootPageId , $ changedTime , $ indexingConfiguration ) ; } else { // add the item since it's not in the queue yet $ updatedRows = $ this -> addNewItem ( $ itemType , $ itemUid , $ indexingConfiguration , $ rootPageId ) ; } $ updateCount += $ updatedRows ; } return $ updateCount ; }
Updates or add's the item for all relevant root pages.

@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 int $forcedChangeTime The change time for the item if set, otherwise value from getItemChangedTime() is used.
@return int
Updates or add s the item for all relevant root pages .