protected function getItemChangedTime($itemType, $itemUid)
    {
        $itemTypeHasStartTimeColumn = false;
        $changedTimeColumns = $GLOBALS['TCA'][$itemType]['ctrl']['tstamp'];
        $startTime = 0;
        $pageChangedTime = 0;

        if (!empty($GLOBALS['TCA'][$itemType]['ctrl']['enablecolumns']['starttime'])) {
            $itemTypeHasStartTimeColumn = true;
            $changedTimeColumns .= ', ' . $GLOBALS['TCA'][$itemType]['ctrl']['enablecolumns']['starttime'];
        }
        if ($itemType === 'pages') {
            // does not carry time information directly, but needed to support
            // canonical pages
            $changedTimeColumns .= ', content_from_pid';
        }

        $record = BackendUtility::getRecord($itemType, $itemUid, $changedTimeColumns);
        $itemChangedTime = $record[$GLOBALS['TCA'][$itemType]['ctrl']['tstamp']];

        if ($itemTypeHasStartTimeColumn) {
            $startTime = $record[$GLOBALS['TCA'][$itemType]['ctrl']['enablecolumns']['starttime']];
        }

        if ($itemType === 'pages') {
            $record['uid'] = $itemUid;
            // overrule the page's last changed time with the most recent
            //content element change
            $pageChangedTime = $this->getPageItemChangedTime($record);
        }

        $localizationsChangedTime = $this->queueItemRepository->getLocalizableItemChangedTime($itemType, (int)$itemUid);

        // if start time exists and start time is higher than last changed timestamp
        // then set changed to the future start time to make the item
        // indexed at a later time
        $changedTime = max(
            $itemChangedTime,
            $pageChangedTime,
            $localizationsChangedTime,
            $startTime
        );

        return $changedTime;
    }
protected function getItemChangedTime($itemType, $itemUid)
    {
        $itemTypeHasStartTimeColumn = false;
        $changedTimeColumns = $GLOBALS['TCA'][$itemType]['ctrl']['tstamp'];
        $startTime = 0;
        $pageChangedTime = 0;

        if (!empty($GLOBALS['TCA'][$itemType]['ctrl']['enablecolumns']['starttime'])) {
            $itemTypeHasStartTimeColumn = true;
            $changedTimeColumns .= ', ' . $GLOBALS['TCA'][$itemType]['ctrl']['enablecolumns']['starttime'];
        }
        if ($itemType === 'pages') {
            // does not carry time information directly, but needed to support
            // canonical pages
            $changedTimeColumns .= ', content_from_pid';
        }

        $record = BackendUtility::getRecord($itemType, $itemUid, $changedTimeColumns);
        $itemChangedTime = $record[$GLOBALS['TCA'][$itemType]['ctrl']['tstamp']];

        if ($itemTypeHasStartTimeColumn) {
            $startTime = $record[$GLOBALS['TCA'][$itemType]['ctrl']['enablecolumns']['starttime']];
        }

        if ($itemType === 'pages') {
            $record['uid'] = $itemUid;
            // overrule the page's last changed time with the most recent
            //content element change
            $pageChangedTime = $this->getPageItemChangedTime($record);
        }

        $localizationsChangedTime = $this->queueItemRepository->getLocalizableItemChangedTime($itemType, (int)$itemUid);

        // if start time exists and start time is higher than last changed timestamp
        // then set changed to the future start time to make the item
        // indexed at a later time
        $changedTime = max(
            $itemChangedTime,
            $pageChangedTime,
            $localizationsChangedTime,
            $startTime
        );

        return $changedTime;
    }
protected function getItemChangedTime ( $ itemType , $ itemUid ) { $ itemTypeHasStartTimeColumn = false ; $ changedTimeColumns = $ GLOBALS [ 'TCA' ] [ $ itemType ] [ 'ctrl' ] [ 'tstamp' ] ; $ startTime = 0 ; $ pageChangedTime = 0 ; if ( ! empty ( $ GLOBALS [ 'TCA' ] [ $ itemType ] [ 'ctrl' ] [ 'enablecolumns' ] [ 'starttime' ] ) ) { $ itemTypeHasStartTimeColumn = true ; $ changedTimeColumns .= ', ' . $ GLOBALS [ 'TCA' ] [ $ itemType ] [ 'ctrl' ] [ 'enablecolumns' ] [ 'starttime' ] ; } if ( $ itemType === 'pages' ) { // does not carry time information directly, but needed to support // canonical pages $ changedTimeColumns .= ', content_from_pid' ; } $ record = BackendUtility :: getRecord ( $ itemType , $ itemUid , $ changedTimeColumns ) ; $ itemChangedTime = $ record [ $ GLOBALS [ 'TCA' ] [ $ itemType ] [ 'ctrl' ] [ 'tstamp' ] ] ; if ( $ itemTypeHasStartTimeColumn ) { $ startTime = $ record [ $ GLOBALS [ 'TCA' ] [ $ itemType ] [ 'ctrl' ] [ 'enablecolumns' ] [ 'starttime' ] ] ; } if ( $ itemType === 'pages' ) { $ record [ 'uid' ] = $ itemUid ; // overrule the page's last changed time with the most recent //content element change $ pageChangedTime = $ this -> getPageItemChangedTime ( $ record ) ; } $ localizationsChangedTime = $ this -> queueItemRepository -> getLocalizableItemChangedTime ( $ itemType , ( int ) $ itemUid ) ; // if start time exists and start time is higher than last changed timestamp // then set changed to the future start time to make the item // indexed at a later time $ changedTime = max ( $ itemChangedTime , $ pageChangedTime , $ localizationsChangedTime , $ startTime ) ; return $ changedTime ; }
Determines the time for when an item should be indexed. This timestamp
is then stored in the changed column in the Index Queue.

The changed timestamp usually is now - time(). For records which are set
to published at a later time, this timestamp is the start time. So if a
future start time has been set, that will be used to delay indexing
of an item.

@param string $itemType The item's table name.
@param string $itemUid The item's uid, usually an integer uid, could be a
different value for non-database-record types.
@return int Timestamp of the item's changed time or future start time
Determines the time for when an item should be indexed . This timestamp is then stored in the changed column in the Index Queue .