Save the manual order inputs from the categories list page.

@return      void

@since       1.6
@see         JControllerAdmin::saveorder()
@deprecated  4.0
335969
public function saveorder()
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		JLog::add('CategoriesControllerCategories::saveorder() is deprecated. Function will be removed in 4.0', JLog::WARNING, 'deprecated');

		// Get the arrays from the Request
		$order = $this->input->post->get('order', null, 'array');
		$originalOrder = explode(',', $this->input->getString('original_order_values'));

		// Make sure something has changed
		if (!($order === $originalOrder))
		{
			parent::saveorder();
		}
		else
		{
			// Nothing to reorder
			$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list, false));

			return true;
		}
	}
701679
public function setOrder()
    {
        // set order position if exist
        $order = [];
        foreach ($this->data['order'] as $alias => $params) {

            $order = array_flip($order);

            if (empty($params) === false) {

                foreach ($params as $field => $sort) {
                    $order[] = $alias . '.' . $field . ' ' . $sort;
                }
            }
        }

        $this->builder->orderBy($order);

        return null;
    }
902953
public function cmdAddOrder()
    {
        $submitted = $this->getParam();

        $this->setSubmitted(null, $submitted);
        $this->setSubmittedJson('data');

        $this->validateComponent('order');

        if ($this->isError()) {
            $this->output();
        }

        $id = $this->order->add($this->getSubmitted());

        if (empty($id)) {
            $this->errorAndExit($this->text('Unexpected result'));
        }

        $this->line($id);
        $this->output();
    }
667981
protected function SaveOrderIdAsLastCreatedOrderInSession($oOrder)
    {
        $_SESSION[self::SESSION_KEY_LAST_CREATED_ORDER_ID] = $oOrder->id;
        $myOrderHistory = $this->myOrderDetailHandlerFactory();
        $myOrderHistory->addOrderIdToMyList($oOrder->id, ('' !== $oOrder->fieldDataExtranetUserId) ? $oOrder->fieldDataExtranetUserId : null);
    }
845017
public function onAfterWrite()
    {
        parent::onAfterWrite();

        // Check if an order number has been generated, if not, add it and save again
        if (!$this->Ref) {
            $this->Ref = $this->generateOrderNumber();
            $this->write();
        }
    }
460264
public function listOrder()
    {
        $this->actionListOrder();
        $this->setTitleListOrder();
        $this->setBreadcrumbListOrder();
        $this->setData('statuses', $this->order->getStatuses());

        $this->setFilterListOrder();
        $this->setPagerListOrder();
        $this->setData('orders', $this->getListOrder());

        $this->outputListOrder();
    }
883670
public function onSortAttachments()
    {
        if ($sortData = post('sortOrder')) {
            $ids = array_keys($sortData);
            $orders = array_values($sortData);

            $fileModel = $this->getRelationModel();
            $fileModel->setSortableOrder($ids, $orders);
        }
    }
1043393
protected function save()
    {
        $this->db->createCommand()->update($this->tableName, [
            'updated_at' => time(),
            'data' => [serialize($this->_states), \PDO::PARAM_LOB],
            ], ['id' => $this->_id])->execute();
    }
739377
protected function storeActiveSortInSession()
    {
        if (null !== $this->activeSortDescending) {
            $direction = $this->activeSortDescending ? 'desc' : 'asc';
        } else {
            $direction = null;
        }

        $this->getListMemory()->setSortData($this->activeSort, $direction);
    }
208215
public function save()
    {
        // saving/updating seo params
        if (($sOxid = $this->_getSaveObjectId())) {
            $aSeoData = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('aSeoData');
            $iShopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
            $iLang = $this->getEditLang();

            // checkbox handling
            if (!isset($aSeoData['oxfixed'])) {
                $aSeoData['oxfixed'] = 0;
            }

            $sParams = $this->_getAdditionalParams($aSeoData);

            $oEncoder = $this->_getEncoder();
            // marking self and page links as expired
            $oEncoder->markAsExpired($sOxid, $iShopId, 1, $iLang, $sParams);

            // saving
            $oEncoder->addSeoEntry(
                $sOxid,
                $iShopId,
                $iLang,
                $this->_getStdUrl($sOxid),
                $aSeoData['oxseourl'],
                $this->_getSeoEntryType(),
                $aSeoData['oxfixed'],
                trim($aSeoData['oxkeywords']),
                trim($aSeoData['oxdescription']),
                $this->processParam($aSeoData['oxparams']),
                true,
                $this->_getAltSeoEntryId()
            );
        }
    }
354158
private function applyOrdering()
    {
        if (empty($this->menu)
            || $this->orderingApplied
        ) {
            return;
        }

        uasort($this->menu, array($this, 'menuCompare'));
        foreach ($this->menu as $key => &$element) {
            if (is_null($element)) {
                unset($this->menu[$key]);
            } elseif ($element['_hasSubmenu']) {
                uasort($element, array($this, 'menuCompare'));
            }
        }

        $this->orderingApplied = true;
    }
210614
public function cancelOrderArticle()
    {
        if ($this->oxorderarticles__oxstorno->value == 0) {
            $myConfig = \OxidEsales\Eshop\Core\Registry::getConfig();
            $this->oxorderarticles__oxstorno = new \OxidEsales\Eshop\Core\Field(1);
            if ($this->save()) {
                $this->updateArticleStock($this->oxorderarticles__oxamount->value, $myConfig->getConfigParam('blAllowNegativeStock'));
            }
        }
    }
1213767
protected function updateStatusOrder()
    {
        $this->controlAccess('order_edit');

        $submitted = array('status' => $this->getSubmitted('status'));

        if ($this->order->update($this->data_order['order_id'], $submitted)) {
            $submitted['notify'] = $this->setNotificationUpdateOrder($this->data_order['order_id']);
            $this->logUpdateStatusOrder($submitted);
            $messages = $this->getMassagesUpdateOrder();
            list($severity, $text) = $messages[$submitted['notify']];
            $this->redirect('', $this->text($text), $severity);
        }

        $this->redirect('', $this->text('Order has not been updated'), 'warning');
    }
293570
public function saveOrder()
    {
        $om = $this->objectManager;

        // First check if the order needs an insert or an update
        if (($ipnOrder = $om->getRepository($this->clsIpnOrders)
                ->findOneByTxnId($this->ipnData['txn_id']))) {
            $this->order->setId($ipnOrder->getId());//Update
            $om->merge($this->order);// Let's save/merge the order down
        } else {
            $om->persist($this->order); //If not exist in database, create new
            $om->flush(); //save order to get insert id
        }

        // Now let's save the order's line items
        foreach ($this->orderItems as $i => $item) {
            // We need to check if we have already saved this into the database...
            if (($ipnOrderItem = $om->getRepository($this->clsIpnOrderItems)
                    ->findOneBy(array('itemName' => $item->getItemName(), 'orderId' => $this->order->getId())))) {
                $this->orderItems[$i]->setId($ipnOrderItem->getId()); //Update
                $this->orderItems[$i]->setOrderId($this->order->getId()); // set related order
                $om->merge($this->orderItems[$i]);// Let's save/merge the order down
            } else {
                $om->persist($this->orderItems[$i]); //If not exist in database, create new
            }          
            $this->orderItems[$i]->setOrderId($this->order->getId());
        }
        // Let's store all of the data (order and order items)
        $om->flush();
    }
413161
public function setOrderItemCategory($orderItemCategory) 
    {
        if (!$this->_isNumericArray($orderItemCategory)) {
            $orderItemCategory =  array ($orderItemCategory);    
        }
        $this->fields['OrderItemCategory']['FieldValue'] = $orderItemCategory;
        return $this;
    }
1359635
protected function _save()
    {
        if ($this->isSaveToDataBaseEnabled()) {
            if ($oUser = $this->getBasketUser()) {
                //first delete all contents
                //#2039
                $oSavedBasket = $oUser->getBasket('savedbasket');
                $oSavedBasket->delete();

                //then save
                /** @var \oxBasketItem $oBasketItem */
                foreach ($this->_aBasketContents as $oBasketItem) {
                    // discount or bundled products will be added automatically if available
                    if (!$oBasketItem->isBundle() && !$oBasketItem->isDiscountArticle()) {
                        $oSavedBasket->addItemToBasket($oBasketItem->getProductId(), $oBasketItem->getAmount(), $oBasketItem->getSelList(), true, $oBasketItem->getPersParams());
                    }
                }
            }
        }
    }
1347325
private function setQueryOrder()
    {
        if ($this->hasInput('column_orders'))
        {
            // before we process the order, we need to check if
            // single order is set.
            // and remove other column_orders keys and method except for the single order
            // specified.
            if ($this->hasInput('single_order') && isset($this->columns[$this->getInput('single_order')]))
            {
                // single_order might empty
                $single_order = $this->getInput('single_order');

                if ( ! empty($single_order))
                {
                    foreach ($this->requestParameters['column_orders'] as $key => $value)
                    {
                        if ($key != $single_order)
                        {
                            unset($this->requestParameters['column_orders'][$key]);
                        }
                    }
                }
            }

            // overide default column_orders keys and methods
            $column_orders_input = $this->getInput('column_orders');
            if (!empty($column_orders_input) && is_array($column_orders_input))
            {
                // $input_orders method
                foreach ($column_orders_input as $order_by => $order_method)
                {
                    if (!array_key_exists($order_by, $this->columns))
                    {
                        unset($column_orders_input[$order_by]);
                    }
                    else
                    {
                        if (!is_string($order_method) || !in_array($order_method, array('asc', 'desc')))
                        {
                            $column_orders_input[$order_by] = 'asc';
                        }
                    }
                }

                // override default order
                $this->columnOrders = $column_orders_input;
            }
        }

        // load default column_orders
        // no need to perform validation since
        // tblist assumes that it is a system generated data
        // not user generated data.
        foreach ($this->columnOrders as $column_key => $order_method)
        {
            // just set the default order query string
            // just like: order by column_name desc
            $table_column = $this->getColumnOption($column_key, self::COLUMN_OPTION_TABLE_COLUMN, $column_key);
            $this->query->orderBy($table_column, $order_method);
        }
    }