Disables / reorders specific input fields in billing address fieldset.

@param array $jsLayout
@return array
494730
private function modifyBillingFields($jsLayout)
    {
        $fieldOrder = $this->getFieldOrder();
        foreach ($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
                 ['payment']['children']['payments-list']['children'] as $code => &$payment) {
            if (isset($payment['children']['form-fields'])) {
                $billingFields = &$payment['children']['form-fields']['children'];

                foreach ($billingFields as $fieldName => $billingField) {
                    if (isset($fieldOrder[$fieldName])) {
                        $billingFields[$fieldName]['sortOrder'] = $fieldOrder[$fieldName];
                    }
                }

                foreach (self::DISABLE_FIELDS as $field) {
                    $configPath = sprintf(self::CONFIG_DISABLE_FIELD_PATH, $field);
                    if ($this->scopeConfig->getValue($configPath, ScopeInterface::SCOPE_STORE)) {
                        unset($billingFields[$field]);
                    }
                }
            }
        }
        return $jsLayout;
    }
57101
public function orderBy($fields, $defaultDirection = 'ASC')
    {
        if (!is_array($fields)) {
            $fields = array($fields);
        }

        foreach ($fields as $key => $value) {
            $field = $key;
            $type = $value;
            if (is_int($key)) {
                $field = $value;
                $type = $defaultDirection;
            }
            if (!$field instanceof Raw) {
                $field = $this->addTablePrefix($field);
            }
            $this->statements['orderBys'][] = compact('field', 'type');
        }

        return $this;
    }
702174
protected function getFieldClientOptions($field)
    {
        $attribute = Html::getAttributeName($field->attribute);
        if (!in_array($attribute, $field->model->activeAttributes(), true)) {
            return [];
        }

        $clientValidation = $field->isClientValidationEnabled();
        $ajaxValidation = $field->isAjaxValidationEnabled();

        if ($clientValidation) {
            $validators = [];
            foreach ($field->model->getActiveValidators($attribute) as $validator) {
                /* @var $validator \yii\validators\Validator */
                if (!$validator->enableClientValidation) {
                    continue;
                }

                $js = $validator->clientValidateAttribute($field->model, $attribute, $field->form->getView());
                if ($js === null || $js === '') {
                    $js = $this->buildClientValidator($validator, $field->model, $attribute, $field->form->getView());
                }

                if ($js !== '') {
                    if ($validator->whenClient !== null) {
                        $js = "if (({$validator->whenClient})(attribute, value)) { $js }";
                    }
                    $validators[] = $js;
                }
            }
        }

        if (!$ajaxValidation && (!$clientValidation || empty($validators))) {
            return [];
        }

        $options = [];

        $inputID = $field->getInputId();
        $options['id'] = Html::getInputId($field->model, $field->attribute);
        $options['name'] = $field->attribute;

        $options['container'] = $field->selectors['container'] ?? ".field-$inputID";
        $options['input'] = $field->selectors['input'] ?? "#$inputID";
        if (isset($field->selectors['error'])) {
            $options['error'] = $field->selectors['error'];
        } elseif (isset($field->errorOptions['class'])) {
            $options['error'] = '.'.implode('.', preg_split('/\s+/', $field->errorOptions['class'], -1, PREG_SPLIT_NO_EMPTY));
        } else {
            $options['error'] = $field->errorOptions['tag'] ?? 'span';
        }

        $options['encodeError'] = !isset($field->errorOptions['encode']) || $field->errorOptions['encode'];
        if ($ajaxValidation) {
            $options['enableAjaxValidation'] = true;
        }
        foreach (['validateOnChange', 'validateOnBlur', 'validateOnType', 'validationDelay'] as $name) {
            $options[$name] = $field->$name ?? $field->form->$name;
        }

        if (!empty($validators)) {
            $options['validate'] = new JsExpression('function (attribute, value, messages, deferred, $form) {'.implode('', $validators).'}');
        }

        if ($field->addAriaAttributes === false) {
            $options['updateAriaInvalid'] = false;
        }

        return $options;
    }
1030872
public function getCarouselEditFields()
    {
        // This is *required* otherwise TinyMCE in SilverStripe 3.3 will
        // not be enabled and the <textarea> will simply disappear
        // without apparent reasons
        if (method_exists('HtmlEditorConfig', 'require_js')) {
            HtmlEditorConfig::require_js();
        }

        $fields = FieldList::create();
        $fields->push(CarouselCaptionField::create('Content', _t('CarouselPage.Caption')));
        return $fields;
    }
37127
public function Field($properties = array()) {
		Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/typeahead.js');
		Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/bootstrap-tagfield.js');
		Requirements::javascript(BOOTSTRAP_TAGFIELD_DIR.'/javascript/bootstrap-tagfield-init.js');
		Requirements::css(BOOTSTRAP_TAGFIELD_DIR.'/css/bootstrap-tagfield.css');

		$this->setAttribute('data-value', $this->getValuesJSON())
			 ->setAttribute('data-bootstrap-tags', true)
			 ->setAttribute('data-query-url', $this->Link('query'))
			 ->setAttribute('data-prefetch-url', $this->Link('prefetch'))
			 ->setAttribute('data-freeinput', $this->freeInput)
			 ->setAttribute('class', 'text');
		
		return $this->renderWith(
			$this->getTemplates()
		);
	}
746885
function Form(domElement) {
		this.addresses = [];
		this.dom = domElement;

		this.activeAddressesNotAccepted = function () {
			var addrs = [];
			for (var i = 0; i < this.addresses.length; i++) {
				var addr = this.addresses[i];
				if (addr.status() != "accepted" && addr.active)
					addrs.push(addr);
			}
			return addrs;
		};

		this.allActiveAddressesAccepted = function () {
			return this.activeAddressesNotAccepted().length == 0;
		};
	}
186007
public function FieldHolder($attributes = array ()) {

		if(!Config::inst()->get('BootstrapForm', 'jquery_included')) {
			Requirements::javascript(THIRDPARTY_DIR."/jquery/jquery.js");
			Requirements::javascript(FRAMEWORK_DIR."/admin/thirdparty/chosen/chosen/chosen.jquery.js");
			Requirements::css(FRAMEWORK_DIR."/admin/thirdparty/chosen/chosen/chosen.css");
		} else {
			Requirements::javascript(BOOTSTRAP_FORMS_DIR."/javascript/chosen/chosen.jquery.js");
			Requirements::css(BOOTSTRAP_FORMS_DIR."/javascript/chosen/chosen.css");
		}
		
		$this->addExtraClass('chosen');
		if(!$this->getAttribute('data-search-threshold')) {
			$this->setSearchThreshold(self::$default_search_threshold);
		}
		return parent::FieldHolder($attributes);
	}
484663
private function removeAdditionalTableDuplicateFields()
    {
        $columns = $this->getSelect()->getPart(\Zend_Db_Select::COLUMNS);

        foreach ($columns as $idx => $column) {
            if ($column[0] == 'additional_table' && $column[1] == "*") {
                unset($columns[$idx]);
            }
        }

        $this->getSelect()->setPart(\Zend_Db_Select::COLUMNS, $columns);

        foreach ($this->getAdditionalTableFields() as $fieldName) {
            $this->getSelect()->columns([$fieldName => sprintf("additional_table.%s", $fieldName)]);
        }

        return $this;
    }
709934
protected function getShippingAddress(TdbShopOrder $order, $cachingEnabled, IMapperCacheTriggerRestricted $cacheTriggerManager)
    {
        if ($order->fieldAdrShippingUseBilling) {
            return $this->getBillingAddress($order, $cachingEnabled, $cacheTriggerManager);
        }
        $salutation = $order->GetFieldAdrShippingSalutation();
        if ($salutation && $cachingEnabled) {
            $cacheTriggerManager->addTrigger($salutation->table, $salutation->id);
        }
        $address = '';
        $address .= (null !== $salutation) ? $salutation->GetName().' ' : '';
        $address .= $this->getValueOrDefault($order->fieldAdrShippingFirstname, ' ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingLastname, ', ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingAdditionalInfo, ', ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingStreet, ' ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingStreetnr, ', ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingPostalcode, ' ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingCity);

        return $address;
    }
1286470
private function changeCartItemsSortOrder($jsLayout)
    {
        if ($this->scopeConfig->getValue(self::CONFIG_MOVE_CART_ITEMS_PATH, ScopeInterface::SCOPE_STORE)) {
            $jsLayout['components']['checkout']['children']['sidebar']['children']['summary']['children']['cart_items']
                ['sortOrder'] = 0;
        }
        return $jsLayout;
    }
40361
function getUserFields(selector, sort) {
  var selectorFields = Object.keys(selector);
  var sortFields = sort? sort.map(getKey) : [];
  var userFields;
  if (selectorFields.length >= sortFields.length) {
    userFields = selectorFields;
  } else {
    userFields = sortFields;
  }

  if (sortFields.length === 0) {
    return {
      fields: userFields
    };
  }

  // sort according to the user's preferred sorting
  userFields = userFields.sort(function (left, right) {
    var leftIdx = sortFields.indexOf(left);
    if (leftIdx === -1) {
      leftIdx = Number.MAX_VALUE;
    }
    var rightIdx = sortFields.indexOf(right);
    if (rightIdx === -1) {
      rightIdx = Number.MAX_VALUE;
    }
    return leftIdx < rightIdx ? -1 : leftIdx > rightIdx ? 1 : 0;
  });

  return {
    fields: userFields,
    sortOrder: sort.map(getKey)
  };
}
697826
public function optionToChangeAddress()
    {
        if (!$this->onReviewStep()) {
            if (!Mage::helper('adyen')->getConfigData('allow_quest_checkout', 'adyen_apple_pay')) {
                return Mage::helper('adyen')->getConfigData('change_address', 'adyen_apple_pay');
            }

            return true;
        }

        return false;
    }
54874
public function validateAdminOrderAddressSave(Varien_Event_Observer $observer)
    {
        /** @var Fontis_Australia_Helper_Address $helper */
        $helper = Mage::helper('australia/address');
        if (!$helper->isValidationOrderSaveEnabled()) {
            return;
        }

        /** @var Mage_Adminhtml_Model_Session $session */
        $session = Mage::getSingleton('adminhtml/session');
        $errors = $session->getMessages()->getErrors();

        if (count($errors) > 0) {
            // We had an error when saving the address, so we'll skip validation
            $session->addWarning('Address validation has been skipped.');
            return;
        }

        try {
            /** @var Mage_Adminhtml_Controller_Action $controller */
            $controller = $observer->getControllerAction();
            if (!$controller) {
                return;
            }

            $addressId = $controller->getRequest()->getParam('address_id');
            /** @var Mage_Sales_Model_Order_Address $address */
            $address = Mage::getModel('sales/order_address')->load($addressId);
            if ($address->getAddressType() !== Mage_Sales_Model_Order_Address::TYPE_SHIPPING) {
                return;
            }
            $order = $address->getOrder();
            if (!$order) {
                return;
            }

            $ignoreValidation = $controller->getRequest()->getParam('override_validation');

            if ($ignoreValidation) {
                $result = array(
                    Fontis_Australia_Helper_Address::ADDRESS_OVERRIDE_FLAG => true
                );
                $order->setAddressValidated(Fontis_Australia_Helper_Address::ADDRESS_OVERRIDE);
            } else {
                // Validate the address and store the result on the order.
                $result = $helper->validateOrderAddress($order);
            }

            $order->save();

            // Use the result to add a message to the session telling the
            // admin about the validation status.
            $helper->addValidationMessageToSession($result, $session);
        } catch (Exception $err) {
            Mage::logException($err);
        }
    }
393499
public function getAllEmailAddresses($fields = ['to', 'from', 'cc', 'bcc'])
    {
        $addresses = [];
        foreach ($fields as $field) {
            if(isset($this->allEmailAddressesByField[$field])) {
                foreach ($this->allEmailAddressesByField[$field] as $emailAddress) {
                    $addresses[] = $emailAddress;
                }
            }
        }

        return array_unique($addresses);
    }
1285489
public function commentsFieldsOrderSetting($fields)
    {
        add_filter('comment_form_fields', function ($comment_fields) use ($fields) {
            $new_fields = [];

            // Iterate on fields
            foreach ($fields as $field) {
                if (!isset($comment_fields[$field])) {
                    continue;
                }

                $new_fields[$field] = $comment_fields[$field];
            }

            return $new_fields;
        });
    }
853678
public function setUnusedElements(array &$fieldArray)
    {
        $changedGridElements = [];
        $changedElements = [];
        $changedSubPageElements = [];

        if ($this->getTable() === 'tt_content') {
            $changedGridElements[$this->getContentUid()] = true;
            $childElementsInUnavailableColumns = [];
            $childElementsInAvailableColumns = [];
            $availableColumns = $this->getAvailableColumns($fieldArray['tx_gridelements_backend_layout'], 'tt_content');
            if (!empty($availableColumns) || $availableColumns === '0') {
                $availableColumns = GeneralUtility::intExplode(',', $availableColumns);
                $queryBuilder = $this->getQueryBuilder();
                $childElementsInUnavailableColumnsQuery = $queryBuilder
                    ->select('uid')
                    ->from('tt_content')
                    ->where(
                        $queryBuilder->expr()->andX(
                            $queryBuilder->expr()->gt('tx_gridelements_container', 0),
                            $queryBuilder->expr()->eq(
                                'tx_gridelements_container',
                                $queryBuilder->createNamedParameter((int)$this->getContentUid(), \PDO::PARAM_INT)
                            ),
                            $queryBuilder->expr()->notIn(
                                'tx_gridelements_columns',
                                $queryBuilder->createNamedParameter($availableColumns, Connection::PARAM_INT_ARRAY)
                            )
                        )
                    )
                    ->execute();
                $childElementsInUnavailableColumns = [];
                while ($childElementInUnavailableColumns = $childElementsInUnavailableColumnsQuery->fetch()) {
                    $childElementsInUnavailableColumns[] = $childElementInUnavailableColumns['uid'];
                }
                if (!empty($childElementsInUnavailableColumns)) {
                    $queryBuilder
                        ->update('tt_content')
                        ->where(
                            $queryBuilder->expr()->in(
                                'uid',
                                $queryBuilder->createNamedParameter(
                                    $childElementsInUnavailableColumns,
                                    Connection::PARAM_INT_ARRAY
                                )
                            )
                        )
                        ->set('colPos', -2)
                        ->set('backupColPos', -1)
                        ->execute();
                    array_flip($childElementsInUnavailableColumns);
                }

                $queryBuilder = $this->getQueryBuilder();
                $childElementsInAvailableColumnsQuery = $queryBuilder
                    ->select('uid')
                    ->from('tt_content')
                    ->where(
                        $queryBuilder->expr()->andX(
                            $queryBuilder->expr()->gt('tx_gridelements_container', 0),
                            $queryBuilder->expr()->eq(
                                'tx_gridelements_container',
                                $queryBuilder->createNamedParameter((int)$this->getContentUid(), \PDO::PARAM_INT)
                            ),
                            $queryBuilder->expr()->in(
                                'tx_gridelements_columns',
                                $queryBuilder->createNamedParameter($availableColumns, Connection::PARAM_INT_ARRAY)
                            )
                        )
                    )
                    ->execute();
                $childElementsInAvailableColumns = [];
                while ($childElementInAvailableColumns = $childElementsInAvailableColumnsQuery->fetch()) {
                    $childElementsInAvailableColumns[] = $childElementInAvailableColumns['uid'];
                }
                if (!empty($childElementsInAvailableColumns)) {
                    $queryBuilder
                        ->update('tt_content')
                        ->where(
                            $queryBuilder->expr()->in(
                                'uid',
                                $queryBuilder->createNamedParameter(
                                    $childElementsInAvailableColumns,
                                    Connection::PARAM_INT_ARRAY
                                )
                            )
                        )
                        ->set('colPos', -1)
                        ->set('backupColPos', -2)
                        ->execute();
                    array_flip($childElementsInAvailableColumns);
                }
            }
            $changedGridElements = $changedGridElements + $childElementsInUnavailableColumns + $childElementsInAvailableColumns;
        }

        if ($this->getTable() === 'pages') {
            $backendLayoutUid = 0;
            $backendLayoutNextLevelUid = 0;
            $rootline = BackendUtility::BEgetRootLine($this->getPageUid());
            for ($i = count($rootline); $i > 0; $i--) {
                $page = BackendUtility::getRecord(
                    'pages',
                    (int)$rootline[$i]['uid'],
                    'uid,backend_layout,backend_layout_next_level'
                );
                $selectedBackendLayoutNextLevel = (int)$page['backend_layout_next_level'];
                if ($page['uid'] === $this->getPageUid()) {
                    if ($fieldArray['backend_layout_next_level'] !== 0) {
                        // Backend layout for sub pages of the current page is set
                        $backendLayoutNextLevelUid = (int)$fieldArray['backend_layout_next_level'];
                    }
                    if ($fieldArray['backend_layout'] !== 0) {
                        // Backend layout for current page is set
                        $backendLayoutUid = $fieldArray['backend_layout'];
                        break;
                    }
                } else {
                    if ($selectedBackendLayoutNextLevel === -1 && $page['uid'] !== $this->getPageUid()) {
                        // Some previous page in our rootline sets layout_next to "None"
                        break;
                    }
                    if ($selectedBackendLayoutNextLevel > 0 && $page['uid'] !== $this->getPageUid()) {
                        // Some previous page in our rootline sets some backend_layout, use it
                        $backendLayoutUid = $selectedBackendLayoutNextLevel;
                        break;
                    }
                }
            }

            if (isset($fieldArray['backend_layout'])) {
                $availableColumns = $this->getAvailableColumns($backendLayoutUid, 'pages', $this->getPageUid());
                $availableColumns = GeneralUtility::intExplode(',', $availableColumns);
                $queryBuilder = $this->getQueryBuilder();
                $elementsInUnavailableColumnsQuery = $queryBuilder
                    ->select('uid')
                    ->from('tt_content')
                    ->where(
                        $queryBuilder->expr()->andX(
                            $queryBuilder->expr()->eq(
                                'pid',
                                $queryBuilder->createNamedParameter((int)$this->getPageUid(), \PDO::PARAM_INT)
                            ),
                            $queryBuilder->expr()->notIn(
                                'colPos',
                                $queryBuilder->createNamedParameter($availableColumns, Connection::PARAM_INT_ARRAY)
                            )
                        )
                    )
                    ->execute();
                $elementsInUnavailableColumns = [];
                while ($elementInUnavailableColumns = $elementsInUnavailableColumnsQuery->fetch()) {
                    $elementsInUnavailableColumns[] = $elementInUnavailableColumns['uid'];
                }
                if (!empty($elementsInUnavailableColumns)) {
                    $queryBuilder
                        ->update('tt_content')
                        ->where(
                            $queryBuilder->expr()->in(
                                'uid',
                                $queryBuilder->createNamedParameter(
                                    $elementsInUnavailableColumns,
                                    Connection::PARAM_INT_ARRAY
                                )
                            )
                        )
                        ->set('backupColPos', $queryBuilder->quoteIdentifier('colPos'), false)
                        ->set('colPos', -2)
                        ->execute();
                    array_flip($elementsInUnavailableColumns);
                }

                $queryBuilder = $this->getQueryBuilder();
                $elementsInAvailableColumnsQuery = $queryBuilder
                    ->select('uid')
                    ->from('tt_content')
                    ->where(
                        $queryBuilder->expr()->andX(
                            $queryBuilder->expr()->eq(
                                'pid',
                                $queryBuilder->createNamedParameter((int)$this->getPageUid(), \PDO::PARAM_INT)
                            ),
                            $queryBuilder->expr()->neq(
                                'backupColPos',
                                $queryBuilder->createNamedParameter(-2, \PDO::PARAM_INT)
                            ),
                            $queryBuilder->expr()->in(
                                'backupColPos',
                                $queryBuilder->createNamedParameter($availableColumns, Connection::PARAM_INT_ARRAY)
                            )
                        )
                    )
                    ->execute();
                $elementsInAvailableColumns = [];
                while ($elementInAvailableColumns = $elementsInAvailableColumnsQuery->fetch()) {
                    $elementsInAvailableColumns[] = $elementInAvailableColumns['uid'];
                }
                if (!empty($elementsInAvailableColumns)) {
                    $queryBuilder
                        ->update('tt_content')
                        ->where(
                            $queryBuilder->expr()->in(
                                'uid',
                                $queryBuilder->createNamedParameter(
                                    $elementsInAvailableColumns,
                                    Connection::PARAM_INT_ARRAY
                                )
                            )
                        )
                        ->set('colPos', $queryBuilder->quoteIdentifier('backupColPos'), false)
                        ->set('backupColPos', -2)
                        ->execute();
                    array_flip($elementsInAvailableColumns);
                }
                $changedElements = $elementsInUnavailableColumns + $elementsInAvailableColumns;
            }

            if (isset($fieldArray['backend_layout_next_level'])) {
                $backendLayoutUid = $backendLayoutNextLevelUid ? $backendLayoutNextLevelUid : $backendLayoutUid;
                $subPages = [];
                $this->getSubPagesRecursively($this->getPageUid(), $subPages);
                if (!empty($subPages)) {
                    $changedSubPageElements = [];
                    foreach ($subPages as $page) {
                        $availableColumns = $this->getAvailableColumns($backendLayoutUid, 'pages', $page['uid']);
                        $availableColumns = GeneralUtility::intExplode(',', $availableColumns);
                        $queryBuilder = $this->getQueryBuilder();
                        $subPageElementsInUnavailableColumnsQuery = $queryBuilder
                            ->select('uid')
                            ->from('tt_content')
                            ->where(
                                $queryBuilder->expr()->andX(
                                    $queryBuilder->expr()->eq(
                                        'pid',
                                        $queryBuilder->createNamedParameter((int)$page['uid'], \PDO::PARAM_INT)
                                    ),
                                    $queryBuilder->expr()->notIn(
                                        'colPos',
                                        $queryBuilder->createNamedParameter(
                                            $availableColumns,
                                            Connection::PARAM_INT_ARRAY
                                        )
                                    )
                                )
                            )
                            ->execute();
                        $subPageElementsInUnavailableColumns = [];
                        while ($subPageElementInUnavailableColumns = $subPageElementsInUnavailableColumnsQuery->fetch()) {
                            $subPageElementsInUnavailableColumns[] = $subPageElementInUnavailableColumns['uid'];
                        }
                        if (!empty($subPageElementsInUnavailableColumns)) {
                            $queryBuilder
                                ->update('tt_content')
                                ->where(
                                    $queryBuilder->expr()->in(
                                        'uid',
                                        $queryBuilder->createNamedParameter(
                                            $subPageElementsInUnavailableColumns,
                                            Connection::PARAM_INT_ARRAY
                                        )
                                    )
                                )
                                ->set('backupColPos', $queryBuilder->quoteIdentifier('colPos'), false)
                                ->set('colPos', -2)
                                ->execute();
                            array_flip($subPageElementsInUnavailableColumns);
                        }

                        $queryBuilder = $this->getQueryBuilder();
                        $subPageElementsInAvailableColumnsQuery = $queryBuilder
                            ->select('uid')
                            ->from('tt_content')
                            ->where(
                                $queryBuilder->expr()->andX(
                                    $queryBuilder->expr()->eq(
                                        'pid',
                                        $queryBuilder->createNamedParameter((int)$page['uid'], \PDO::PARAM_INT)
                                    ),
                                    $queryBuilder->expr()->neq(
                                        'backupColPos',
                                        $queryBuilder->createNamedParameter(-2, \PDO::PARAM_INT)
                                    ),
                                    $queryBuilder->expr()->in(
                                        'backupColPos',
                                        $queryBuilder->createNamedParameter(
                                            $availableColumns,
                                            Connection::PARAM_INT_ARRAY
                                        )
                                    )
                                )
                            )
                            ->execute();
                        $subPageElementsInAvailableColumns = [];
                        while ($subPageElementInAvailableColumns = $subPageElementsInAvailableColumnsQuery->fetch()) {
                            $subPageElementsInAvailableColumns[] = $subPageElementInAvailableColumns['uid'];
                        }
                        if (!empty($subPageElementsInAvailableColumns)) {
                            $queryBuilder
                                ->update('tt_content')
                                ->where(
                                    $queryBuilder->expr()->in(
                                        'uid',
                                        $queryBuilder->createNamedParameter(
                                            $subPageElementsInAvailableColumns,
                                            Connection::PARAM_INT_ARRAY
                                        )
                                    )
                                )
                                ->set('colPos', $queryBuilder->quoteIdentifier('backupColPos'), false)
                                ->set('backupColPos', -2)
                                ->execute();
                            array_flip($subPageElementsInAvailableColumns);
                        }

                        $changedPageElements = $subPageElementsInUnavailableColumns + $subPageElementsInAvailableColumns;
                        $changedSubPageElements = $changedSubPageElements + $changedPageElements;
                    }
                }
            }
        }

        $changedElementUids = $changedGridElements + $changedElements + $changedSubPageElements;
        if (!empty($changedElementUids)) {
            foreach ($changedElementUids as $uid => $value) {
                $this->dataHandler->updateRefIndex('tt_content', $uid);
            }
        }
    }
500146
public function renderSlide($isFirst = false, $isMiddle = false, $isLast = false)
    {
        return $this->customise([
            'isFirst' => $isFirst,
            'isMiddle' => $isMiddle,
            'isLast' => $isLast
        ])->renderWith($this->getTemplate());
    }