@param null $order

@return Item[]
963776
public function getItems($order = null)
    {
        if (null === $order) {
            return $this->items;
        }

        return $this->sort($this->items, $order);
    }
328718
public function searchRepositories(string $q, string $sort = null,
                                       string $order = AbstractApi::DIRECTION_DESC): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/search/repositories?:args',
            http_build_query(['q' => $q, 'sort' => $sort, 'order' => $order])));
    }
344706
protected function _getBasketItems($oDiscount = null)
    {
        if ($this->oxvouchers__oxorderid->value) {
            return $this->_getOrderBasketItems($oDiscount);
        } elseif ($this->getSession()->getBasket()) {
            return $this->_getSessionBasketItems($oDiscount);
        } else {
            return [];
        }
    }
426827
protected function getFormParameters(OrderInterface $order)
    {
        return [
            'PSPID' => $this->getOption('pspid'),
            'orderId' => $order->getReference(),
            'amount' => $order->getTotalInc() * 100,
            'currency' => $order->getCurrency()->getLabel(),
            'language' => $order->getLocale(),
            'CN' => $order->getBillingName(),
            'EMAIL' => $order->getBillingEmail(),
            'ownerZIP' => $order->getBillingPostcode(),
            'owneraddress' => $this->getAddress($order),
            'ownercty' => $order->getBillingCity(),
            'ownertelno' => $order->getBillingPhone() ?: $order->getBillingMobile(),

            'homeurl' => $this->getOption('home_url'),
            'catalogurl' => $this->getOption('catalog_url'),

            'COMPLUS' => '',
            'PARAMPLUS' => 'bank='.$this->getCode(),
            'PARAMVAR' => '',

            'PM' => 'CreditCard',
            'WIN3DS' => 'MAINW',
            'PMLIST' => 'VISA;MasterCard;CB',
            'PMListType' => 2,

            'accepturl' => $this->generateAbsoluteUrlFromOption('url_callback', $order),
            'declineurl' => $this->generateAbsoluteUrlFromOption('url_callback', $order),
            'exceptionurl' => $this->generateAbsoluteUrlFromOption('url_return_ko', $order),
            'cancelurl' => $this->generateAbsoluteUrlFromOption('url_return_ko', $order),

            'operation' => $this->getOperation(),
        ];
    }
831246
public function prepareOrder($order = null, $sort = null)
    {
        if ($order == null or $sort == null) {
            $this->setOrderBy = '';

            return $this;
        }

        if (!in_array($sort, ['ASC', 'DESC'])) {
            $sort = 'DESC';
        }

        $this->setOrderBy = ' ORDER BY ' . $order . ' ' . $sort;

        return $this;
    }
455417
public function addItem(GridItem $item, $order = null)
    {
        if (empty($this->getItem($item->getUuid()))) {
            $rowItem = new GridRowItem();
            $rowItem->setOrder(isset($order) || 0 === $order ? $order : $this->rowItems->count());
            $rowItem->setRow($this);
            $rowItem->setItem($item);

            $this->rowItems->add($rowItem);
        }
    }
524292
protected function sort($order)
    {
        $ordered = [];

        $matrix = [
            'label'     => 'getLabels',
            'component' => 'getComponents',
            'message'   => 'getMessage',
        ];

        foreach ($order as $identifier) {
            $components = $this->{$matrix[$identifier]}();
            foreach ($components as $component) {
                $index                              = count($ordered);
                $this->indexReverse[$identifier][0] = $index;
                $this->index[$index]                = $identifier;
                $ordered[]                          = $component;
            }
        }

        return $ordered;
    }
834042
private function findTransformedItem(OrderInterface $order, OrderItemInterface $transformed)
    {
        foreach ($order->getItems() as $item) {
            if ($item->equals($transformed)) {
                return $item;
            }
        }

        return null;
    }
343228
protected function parseOrder($order) {
        if(is_string($order)) {
            $array   =  explode(',',$order);
            $order   =  array();
            foreach ($array as $key=>$val){
                $arr  =  explode(' ',trim($val));
                if(isset($arr[1])) {
                    $arr[1]  =  $arr[1]=='asc'?1:-1;
                }else{
                    $arr[1]  =  1;
                }
                $order[$arr[0]]    = $arr[1];
            }
        }
        return $order;
    }
829799
public function setOrder(\Sulu\Bundle\Sales\OrderBundle\Entity\Order $order = null)
    {
        $this->order = $order;
    
        return $this;
    }
352420
protected final function _getItems($select = null)
    {
        if (!$select) $select = $this->_getSelect();
        if (!$select) return array();

        return $this->getData()->parent->getComponent()->getItems($select);
    }
478780
public function setOrder(\Librinfo\EcommerceBundle\Entity\Order $order = null)
    {
        $this->order = $order;

        return $this;
    }
501138
public function fetchItems($class = null)
    {
        $this->loadFromCookies();
        $items = array();

        if ($class !== null)
        {
            if (!isset($this->items[$class]))
            {
                return array();
            }

            foreach ($this->items[$class] as $id => $item)
            {
                $items [] = array(
                    'class' => $class,
                    'id' => $id,
                    'count' => $item['count'],
                    'cost' => $item['cost']
                );
            }
            return $items;
        }

        $classes = array_keys($this->items);
        foreach ($classes as $class)
        {
            $items = array_merge($items, $this->fetchItems($class));
        }

        return $items;
    }
342619
public function getMethods ($order = FALSE)
	{
		
		// If the methods have not been loaded
		
		if (!$this->methods || $order !== FALSE)
		{
			
			// Set the method class name
			
			$class		=  $this->getNamespace () . '\Method';
			
			// Load the methods
			
			$params['where'][]	= array ('module_id', $this->get ('id'));
			$params['orderby']	= $order?: 'ABS(name)';
			
			$this->methods		= $class::_getObjects ($params);
			
		}
		
		// Return the methods
		
		return $this->methods;
		
	}
1311087
private function processItems($data, Order $order, $locale, $userId = null)
    {
        $result = true;
        try {
            if ($this->checkIfSet('items', $data)) {
                // items has to be an array
                if (!is_array($data['items'])) {
                    throw new MissingOrderAttributeException('items array');
                }

                $items = $data['items'];

                $get = function ($item) {
                    return $item->getId();
                };

                $delete = function ($item) use ($order) {
                    $this->removeItem($item->getEntity(), $order->getEntity());
                };

                $update = function ($item, $matchedEntry) use ($locale, $userId, $order) {
                    $item = $item->getEntity();
                    $itemEntity = $this->updateItem($item, $matchedEntry, $locale, $userId);

                    return $itemEntity ? true : false;
                };

                $add = function ($itemData) use ($locale, $userId, $order) {
                    return $this->addItem($itemData, $locale, $userId, $order);
                };

                $result = $this->processSubEntities(
                    $order->getItems(),
                    $items,
                    $get,
                    $add,
                    $update,
                    $delete
                );
            }
        } catch (\Exception $e) {
            throw new OrderException('Error while creating items: ' . $e->getMessage());
        }

        return $result;
    }
1080198
public function getFieldByOrder($order)
    {
        foreach ($this->_fields as $field) {
            if ($field instanceof FieldInterface) {
                if ($field->getOrder() == $order) {
                    return $field;
                }
            }
        }

        return null;
    }
222646
public function orderBy($orderBy = NULL) {
        if (isset($orderBy)) {
            $this->setOrderBy($orderBy);
            return $this;
        }
        return $this->getOrderBy();
    }