Get content items ordered by the sort property

@return array
197569
public function getOrdered()
    {
        if (!$this->sort) {
            return $this->content;
        }

        $unordered = [];
        foreach ($this->content as $content) {
            $unordered[$content->getId()] = $content;
        }

        $ordered = [];
        $sort = json_decode($this->sort, true);
        $order = $sort['order'];
        foreach ($order as $id) {
            if (isset($unordered[$id])) {
                $ordered[] = $unordered[$id];
            }
        }

        return $ordered;
    }
765694
public function getListSorting()
    {
        $aSorting = parent::getListSorting();
        if (isset($aSorting["oxnews"][$this->_sDefSortField])) {
            $this->_blDesc = true;
        }

        return $aSorting;
    }
354222
public function sortableConcreteData()
    {
        $list = [];
        foreach ($this as $index => $value) {
            $list[$index] = $value;
        }
        return $list;
    }
538167
public function sortColumnsByOrder()
    {
        $columns = $this->_columns;
        foreach ($this->getColumnsOrder() as $columnId => $after) {
            if ($after[0] === '-') {
                $before = substr($after, 1);
                $after = null;
            } else {
                $before = null;
            }
            if ($after !== null && isset($columns[$after])) {
                $currentPosition = array_search($columnId, array_keys($columns));
                $value = array_splice($columns, $currentPosition, 1);

                $destPosition = array_search($after, array_keys($columns)) + 1;
                $columns = array_slice($columns, 0, $destPosition) + $value + array_slice($columns, $destPosition);
            } elseif ($before !== null && $columns[$before]) {
                $currentPosition = array_search($columnId, array_keys($columns));
                $value = array_splice($columns, $currentPosition, 1);

                $destPosition = array_search($before, array_keys($columns));
                $columns = array_slice($columns, 0, $destPosition) + $value + array_slice($columns, $destPosition);
            }
        }

        $this->_columns = $columns;

        end($this->_columns);
        $this->_lastColumnId = key($this->_columns);
        return $this;
    }
1266339
public function getContentRules()
    {
        if (!$this->contentAttribute) {
            return [];
        }
        $rules = [];
        $rules[] = [$this->contentAttribute, 'required'];
        if ($this->contentAttributeRule) {
            if (is_string($this->contentAttributeRule)) {
                $this->contentAttributeRule = [$this->contentAttributeRule];
            }
            if (is_array($this->contentAttributeRule)) {
                $rules[] = array_merge([$this->contentAttribute], $this->contentAttributeRule);
            }
        }

        if (!$this->contentTypeAttribute) {
            return $rules;
        }

        if (is_array($this->contentTypes) && !empty($this->contentTypes)) {
            $rules[] = [[
                $this->contentTypeAttribute],
                'required'];
            $rules[] = [[
                $this->contentTypeAttribute],
                'in',
                'range' => array_keys($this->contentTypes)];
        }
        return $rules;
    }
829731
public function getContents()
    {
        if ($this->contents) {
            if ($this->contents[0]->getType() !== 'text/plain'
            && count($this->contents) > 1
            ) {
                foreach ($this->contents as $key => $value) {
                    if ($value->getType() == 'text/plain') {
                        $plain_content = $value;
                        unset($this->contents[$key]);
                        break;
                    }
                }
                array_unshift($this->contents, $plain_content);
            }
        }

        return $this->contents;
    }
253232
protected function getItemLines()
    {
        $result = array();

        $orderProducts = $this->getOrderModel()->getOrderProducts($this->invoiceSource->getId());
        foreach ($orderProducts as $line) {
            $result[] = $this->getItemLine($line);
        }

        return $result;
    }
142016
public function index()
    {
        return $this->render('index', [
            'pages' => $this->model->getNavItemPageBlockItems()->select(['nav_item_page_id'])->distinct()->orderBy([])->all(),
        ]);
    }
1288959
private function getContents()
    {
        if ($this->contents) {
            return $this->contents;
        }

        return $this->contents = $this->directory->getContents();
    }
155740
public function sort()
    {
        return function (\SplFileInfo $a, \SplFileInfo $b) {
            preg_match(self::PATTERN, $a->getFileName(), $version_a);
            preg_match(self::PATTERN, $b->getFileName(), $version_b);
            return ((int)$version_a[1] < (int)$version_b[1]) ? -1 : 1;
        };
    }
45299
protected function getOrderBy() {
		$order = [];
			
		foreach ($this->getOption('query.orderBy') as $attr) {
			$type = null;
			
			if ($attr instanceof Attr) {
				$name = $attr->getName();
				$type = $attr->getType();
			}
			elseif (is_string($attr)) {
				$expr = explode(' ', $attr);
				$name = $expr[0];
				
				if (count($expr) > 1) {
					$type = strtolower($expr[1]);
					if ($type != 'asc' && $type != 'desc')
						$type = null;
				}	
			}
			else
				throw new \InvalidArgumentException("Invalid order attribute defined: Expected a string or \eMapper\Query\Attr instance");
			
			$order[] = Attr::__callstatic($name)->type($type);
		}
		
		return $order;
	}
294411
public function getOrderTotalLines()
    {
        if (!$this->orderTotalLines) {
            $orderModel = $this->getRegistry()->getOrderModel();
            $this->orderTotalLines = $orderModel->getOrderTotals($this->source['order_id']);
        }
        return $this->orderTotalLines;
    }
5647
public function get_sort_columns() {
        $result = parent::get_sort_columns();

        $assignment = $this->assignment->get_instance();
        if (empty($assignment->blindmarking)) {
            $result = array_merge($result, array('userid' => SORT_ASC));
        } else {
            $result = array_merge($result, [
                    'COALESCE(s.timecreated, '  . time()        . ')'   => SORT_ASC,
                    'COALESCE(s.id, '           . PHP_INT_MAX   . ')'   => SORT_ASC,
                    'um.id'                                             => SORT_ASC,
                ]);
        }
        return $result;
    }
1349718
public function get_sorted_plugins_list() {
        $names = core_component::get_plugin_list($this->subtype);

        $result = array();

        foreach ($names as $name => $path) {
            $idx = get_config($this->subtype . '_' . $name, 'sortorder');
            if (!$idx) {
                $idx = 0;
            }
            while (array_key_exists($idx, $result)) {
                $idx +=1;
            }
            $result[$idx] = $name;
        }
        ksort($result);

        return $result;
    }
46878
public function doSort()
    {
        $this->sorted = array();

        foreach ($this->elements as $element) {
            $parents = array();
            $this->visit($element, $parents);
        }

        return $this->sorted;
    }
1107067
public function getContentList()
    {
        $oContentList = oxNew(\OxidEsales\Eshop\Application\Model\ContentList::class);
        $sTable = getViewName("oxcontents", $this->_iEditLang);
        $oContentList->selectString(
            "SELECT * 
             FROM {$sTable} 
             WHERE OXACTIVE = 1 AND OXTYPE = 0
                AND OXLOADID IN ('oxagb', 'oxdeliveryinfo', 'oximpressum', 'oxrightofwithdrawal')
                AND OXSHOPID = '" . \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("oxid") . "'
             ORDER BY OXLOADID ASC"
        );

        return $oContentList;
    }
768883
private function getContentMenuItems(): array
    {
        $menuItems = [];

        $rootContentId = $this->configResolver->getParameter('location_ids.content_structure');
        $rootMediaId = $this->configResolver->getParameter('location_ids.media');

        $contentStructureItem = $this->factory->createLocationMenuItem(
            self::ITEM_CONTENT__CONTENT_STRUCTURE,
            $rootContentId,
            [
                'label' => self::ITEM_CONTENT__CONTENT_STRUCTURE,
                'extras' => [
                    'routes' => [
                        'search' => 'ezplatform.search',
                        'trash' => 'ezplatform.trash.list',
                        'bookmark' => 'ezplatform.bookmark.list',
                    ],
                ],
            ]
        );
        $mediaItem = $this->factory->createLocationMenuItem(
            self::ITEM_CONTENT__MEDIA,
            $rootMediaId,
            ['label' => self::ITEM_CONTENT__MEDIA]
        );
        $linkManagerItem = $this->createLinkManagerMenuItem();

        if (null !== $contentStructureItem) {
            $menuItems[$contentStructureItem->getName()] = $contentStructureItem;
        }

        if (null !== $mediaItem) {
            $menuItems[$mediaItem->getName()] = $mediaItem;
        }

        if (null !== $linkManagerItem) {
            $menuItems[$linkManagerItem->getName()] = $linkManagerItem;
        }

        return $menuItems;
    }