Classes/Dao/PageSeoDao.php
public function updatePageTableField($pid, $sysLanguage, $fieldName, $fieldValue)
    {
        $tableName = 'pages';

        if (!empty($sysLanguage)) {
            // check if field is in overlay
            if ($this->isFieldInTcaTable('pages_language_overlay', $fieldName)) {
                // Field is in pages language overlay
                $tableName = 'pages_language_overlay';
            }
        }

        switch ($tableName) {
            case 'pages_language_overlay':
                // Update field in pages overlay (also logs update event and clear cache for this page)

                // check uid of pages language overlay
                $query     = 'SELECT uid
                                FROM pages_language_overlay
                               WHERE pid = ' . (int)$pid . '
                                 AND sys_language_uid = ' . (int)$sysLanguage;
                $overlayId = DatabaseUtility::getOne($query);

                if (empty($overlayId)) {
                    // No access

                    throw new AjaxException(
                        'message.error.no_language_overlay_found',
                        '[0x4FBF3C05]',
                        HttpUtility::HTTP_STATUS_BAD_REQUEST
                    );
                }

                // ################
                // UPDATE
                // ################

                $this->getDataHandler()->updateDB(
                    'pages_language_overlay',
                    (int)$overlayId,
                    array(
                        $fieldName => $fieldValue
                    )
                );
                break;
            case 'pages':
                // Update field in page (also logs update event and clear cache for this page)
                $this->getDataHandler()->updateDB(
                    'pages',
                    (int)$pid,
                    array(
                        $fieldName => $fieldValue
                    )
                );
                break;
        }

        return array();
    }
public function updatePageTableField($pid, $sysLanguage, $fieldName, $fieldValue)
    {
        $tableName = 'pages';

        if (!empty($sysLanguage)) {
            // check if field is in overlay
            if ($this->isFieldInTcaTable('pages_language_overlay', $fieldName)) {
                // Field is in pages language overlay
                $tableName = 'pages_language_overlay';
            }
        }

        switch ($tableName) {
            case 'pages_language_overlay':
                // Update field in pages overlay (also logs update event and clear cache for this page)

                // check uid of pages language overlay
                $query     = 'SELECT uid
                                FROM pages_language_overlay
                               WHERE pid = ' . (int)$pid . '
                                 AND sys_language_uid = ' . (int)$sysLanguage;
                $overlayId = DatabaseUtility::getOne($query);

                if (empty($overlayId)) {
                    // No access

                    throw new AjaxException(
                        'message.error.no_language_overlay_found',
                        '[0x4FBF3C05]',
                        HttpUtility::HTTP_STATUS_BAD_REQUEST
                    );
                }

                // ################
                // UPDATE
                // ################

                $this->getDataHandler()->updateDB(
                    'pages_language_overlay',
                    (int)$overlayId,
                    array(
                        $fieldName => $fieldValue
                    )
                );
                break;
            case 'pages':
                // Update field in page (also logs update event and clear cache for this page)
                $this->getDataHandler()->updateDB(
                    'pages',
                    (int)$pid,
                    array(
                        $fieldName => $fieldValue
                    )
                );
                break;
        }

        return array();
    }
public function updatePageTableField ( $ pid , $ sysLanguage , $ fieldName , $ fieldValue ) { $ tableName = 'pages' ; if ( ! empty ( $ sysLanguage ) ) { // check if field is in overlay if ( $ this -> isFieldInTcaTable ( 'pages_language_overlay' , $ fieldName ) ) { // Field is in pages language overlay $ tableName = 'pages_language_overlay' ; } } switch ( $ tableName ) { case 'pages_language_overlay' : // Update field in pages overlay (also logs update event and clear cache for this page) // check uid of pages language overlay $ query = 'SELECT uid
                                FROM pages_language_overlay
                               WHERE pid = ' . ( int ) $ pid . '
                                 AND sys_language_uid = ' . ( int ) $ sysLanguage ; $ overlayId = DatabaseUtility :: getOne ( $ query ) ; if ( empty ( $ overlayId ) ) { // No access throw new AjaxException ( 'message.error.no_language_overlay_found' , '[0x4FBF3C05]' , HttpUtility :: HTTP_STATUS_BAD_REQUEST ) ; } // ################ // UPDATE // ################ $ this -> getDataHandler ( ) -> updateDB ( 'pages_language_overlay' , ( int ) $ overlayId , array ( $ fieldName => $ fieldValue ) ) ; break ; case 'pages' : // Update field in page (also logs update event and clear cache for this page) $ this -> getDataHandler ( ) -> updateDB ( 'pages' , ( int ) $ pid , array ( $ fieldName => $ fieldValue ) ) ; break ; } return array ( ) ; }
Update field in page table

@param integer      $pid         PID
@param integer|NULL $sysLanguage System language id
@param string       $fieldName   Field name
@param string       $fieldValue  Field value

@return array

@throws AjaxException
Update field in page table