public function getLocalizableItemChangedTime(string $itemType, int $itemUid) : int
    {
        $localizedChangedTime = 0;

        if ($itemType === 'pages') {
            $itemType = 'pages_language_overlay';
        }

        if (isset($GLOBALS['TCA'][$itemType]['ctrl']['transOrigPointerField'])) {
            // table is localizable
            $translationOriginalPointerField = $GLOBALS['TCA'][$itemType]['ctrl']['transOrigPointerField'];

            $queryBuilder = $this->getQueryBuilder();
            $queryBuilder->getRestrictions()->removeAll();
            $localizedChangedTime = $queryBuilder
                ->add('select', $queryBuilder->expr()->max('tstamp', 'changed_time'))
                ->from($itemType)
                ->orWhere(
                    $queryBuilder->expr()->eq('uid', $itemUid),
                    $queryBuilder->expr()->eq($translationOriginalPointerField, $itemUid)
                )->execute()->fetchColumn(0);
        }

        return (int)$localizedChangedTime;
    }
public function getLocalizableItemChangedTime(string $itemType, int $itemUid) : int
    {
        $localizedChangedTime = 0;

        if ($itemType === 'pages') {
            $itemType = 'pages_language_overlay';
        }

        if (isset($GLOBALS['TCA'][$itemType]['ctrl']['transOrigPointerField'])) {
            // table is localizable
            $translationOriginalPointerField = $GLOBALS['TCA'][$itemType]['ctrl']['transOrigPointerField'];

            $queryBuilder = $this->getQueryBuilder();
            $queryBuilder->getRestrictions()->removeAll();
            $localizedChangedTime = $queryBuilder
                ->add('select', $queryBuilder->expr()->max('tstamp', 'changed_time'))
                ->from($itemType)
                ->orWhere(
                    $queryBuilder->expr()->eq('uid', $itemUid),
                    $queryBuilder->expr()->eq($translationOriginalPointerField, $itemUid)
                )->execute()->fetchColumn(0);
        }

        return (int)$localizedChangedTime;
    }
public function getLocalizableItemChangedTime ( string $ itemType , int $ itemUid ) : int { $ localizedChangedTime = 0 ; if ( $ itemType === 'pages' ) { $ itemType = 'pages_language_overlay' ; } if ( isset ( $ GLOBALS [ 'TCA' ] [ $ itemType ] [ 'ctrl' ] [ 'transOrigPointerField' ] ) ) { // table is localizable $ translationOriginalPointerField = $ GLOBALS [ 'TCA' ] [ $ itemType ] [ 'ctrl' ] [ 'transOrigPointerField' ] ; $ queryBuilder = $ this -> getQueryBuilder ( ) ; $ queryBuilder -> getRestrictions ( ) -> removeAll ( ) ; $ localizedChangedTime = $ queryBuilder -> add ( 'select' , $ queryBuilder -> expr ( ) -> max ( 'tstamp' , 'changed_time' ) ) -> from ( $ itemType ) -> orWhere ( $ queryBuilder -> expr ( ) -> eq ( 'uid' , $ itemUid ) , $ queryBuilder -> expr ( ) -> eq ( $ translationOriginalPointerField , $ itemUid ) ) -> execute ( ) -> fetchColumn ( 0 ) ; } return ( int ) $ localizedChangedTime ; }
Gets the most recent changed time for an item taking into account
localized records.

@param string $itemType The item's type, usually a table name.
@param int $itemUid The item's uid
@return int Timestamp of the most recent content element change
Gets the most recent changed time for an item taking into account localized records .