public function adjustValuesAfterWorkspaceOperations(array $fieldArray, $uid, DataHandler $parentObj)
    {
        $workspace = $this->getBackendUser()->workspace;
        if ($workspace && (isset($fieldArray['colPos']) || isset($fieldArray['tx_gridelements_container']) || isset($fieldArray['tx_gridelements_columns']))) {
            $originalRecord = $parentObj->recordInfo('tt_content', (int)$uid, '*');
            if ($originalRecord['t3ver_state'] === 4) {
                $updateArray = [];
                $movePlaceholder = BackendUtility::getMovePlaceholder('tt_content', (int)$uid, 'uid', $workspace);
                if (isset($fieldArray['colPos'])) {
                    $updateArray['colPos'] = (int)$fieldArray['colPos'];
                }
                if (isset($fieldArray['tx_gridelements_container'])) {
                    $updateArray['tx_gridelements_container'] = (int)$fieldArray['tx_gridelements_container'];
                }
                if (isset($fieldArray['tx_gridelements_columns'])) {
                    $updateArray['tx_gridelements_columns'] = (int)$fieldArray['tx_gridelements_columns'];
                }
                $parentObj->updateDB('tt_content', (int)$movePlaceholder['uid'], $updateArray);
            }
        }
    }
public function adjustValuesAfterWorkspaceOperations(array $fieldArray, $uid, DataHandler $parentObj)
    {
        $workspace = $this->getBackendUser()->workspace;
        if ($workspace && (isset($fieldArray['colPos']) || isset($fieldArray['tx_gridelements_container']) || isset($fieldArray['tx_gridelements_columns']))) {
            $originalRecord = $parentObj->recordInfo('tt_content', (int)$uid, '*');
            if ($originalRecord['t3ver_state'] === 4) {
                $updateArray = [];
                $movePlaceholder = BackendUtility::getMovePlaceholder('tt_content', (int)$uid, 'uid', $workspace);
                if (isset($fieldArray['colPos'])) {
                    $updateArray['colPos'] = (int)$fieldArray['colPos'];
                }
                if (isset($fieldArray['tx_gridelements_container'])) {
                    $updateArray['tx_gridelements_container'] = (int)$fieldArray['tx_gridelements_container'];
                }
                if (isset($fieldArray['tx_gridelements_columns'])) {
                    $updateArray['tx_gridelements_columns'] = (int)$fieldArray['tx_gridelements_columns'];
                }
                $parentObj->updateDB('tt_content', (int)$movePlaceholder['uid'], $updateArray);
            }
        }
    }
public function adjustValuesAfterWorkspaceOperations ( array $ fieldArray , $ uid , DataHandler $ parentObj ) { $ workspace = $ this -> getBackendUser ( ) -> workspace ; if ( $ workspace && ( isset ( $ fieldArray [ 'colPos' ] ) || isset ( $ fieldArray [ 'tx_gridelements_container' ] ) || isset ( $ fieldArray [ 'tx_gridelements_columns' ] ) ) ) { $ originalRecord = $ parentObj -> recordInfo ( 'tt_content' , ( int ) $ uid , '*' ) ; if ( $ originalRecord [ 't3ver_state' ] === 4 ) { $ updateArray = [ ] ; $ movePlaceholder = BackendUtility :: getMovePlaceholder ( 'tt_content' , ( int ) $ uid , 'uid' , $ workspace ) ; if ( isset ( $ fieldArray [ 'colPos' ] ) ) { $ updateArray [ 'colPos' ] = ( int ) $ fieldArray [ 'colPos' ] ; } if ( isset ( $ fieldArray [ 'tx_gridelements_container' ] ) ) { $ updateArray [ 'tx_gridelements_container' ] = ( int ) $ fieldArray [ 'tx_gridelements_container' ] ; } if ( isset ( $ fieldArray [ 'tx_gridelements_columns' ] ) ) { $ updateArray [ 'tx_gridelements_columns' ] = ( int ) $ fieldArray [ 'tx_gridelements_columns' ] ; } $ parentObj -> updateDB ( 'tt_content' , ( int ) $ movePlaceholder [ 'uid' ] , $ updateArray ) ; } } }
Function to adjust colPos, container and grid column of an element
after it has been moved out of or into a container during a workspace operation

@param array $fieldArray The array of fields and values that have been saved to the datamap
@param int $uid the ID of the record
@param DataHandler $parentObj The parent object that triggered this hook
Function to adjust colPos container and grid column of an element after it has been moved out of or into a container during a workspace operation