reverse sorted.

@return  Samurai\Onikiri\Entities
334138
public function reverse()
    {
        $entities = new Entities();

        foreach (array_reverse($this->_entities) as $entity) {
            $entities->add($entity);
        }

        return $entities;
    }
116686
public function getAutoSort($reverse)
    {
        if ($reverse) {
            if (count($this->sortReverse) == 0) {
                return $this->getAutoInvertedSort();
            } else {
                return $this->sortReverse;
            }
        }

        return $this->sort;
    }
526547
public function getSortedRefs()
    {
        $versions = $this->versions;

        usort($versions, function (version $v1, version $v2) {


            return version::gt($v1, $v2) ? -1 : 1;
        });

        $versions = array_map(function (version $v) {


            return $v->getVersion();
        }, $versions);

        return array_merge($this->branches, $versions);
    }
1329600
public function reverse(){
		
		if($this->_ReadOnly){
			throw new ReadOnlyException(\get_called_class() . ' is read only');
		}
		
		$this->_Arr = \array_reverse($this->_Arr);
		
		return $this;
		
	}
56458
public function rewind()
    {
        if (!$this->sorted) {
            $this->entities = array_reverse($this->entities);
            $this->sorted = true;
        }

        parent::rewind();
    }
825560
public function reverse($preserveKeys = false) : self
    {
        $clone = clone $this;
        $clone->elements = array_reverse($this->elements, $preserveKeys);

        return $clone;
    }
126370
protected function reverseDirection($orders)
	{
		foreach($orders as $column => $direction)
			$orders[$column] = strtolower(trim($direction))==='desc' ? 'ASC' : 'DESC';
		return $orders;
	}
1153783
protected function sortRelationshipsByType()
    {
        $entityClass = $this->getClass();

        // Instantiate a dummy entity which we will pass to relationship methods.
        $entity = unserialize(sprintf('O:%d:"%s":0:{}', strlen($entityClass), $entityClass));

        foreach ($this->relationships as $relation) {
            $this->$relation($entity);
        }
    }
636282
public function ordering()
    {
        if ($this->orderCallback) {
            call_user_func($this->orderCallback, $this);

            return;
        }

        foreach ($this->request->orderableColumns() as $orderable) {
            $column           = $this->getColumnName($orderable['column']);
            $this->collection = $this->collection->sortBy(
                    function ($row) use ($column) {
                $data = $this->serialize($row);

                return Arr::get($data, $column);
            }
            );

            if ($orderable['direction'] == 'desc') {
                $this->collection = $this->collection->reverse();
            }
        }
    }
1199886
public function sort()
    {
        $this->sorted = array();
        $hasChanged   = true;
        while (count($this->sorted) < count($this->items) && $hasChanged) {
            $hasChanged = false;
            foreach ($this->dependencies as $item => $deps) {
                if ($this->satisfied($item)) {
                    $this->setSorted($item);
                    $this->removeDependents($item);
                    $hasChanged = true;
                }
                $this->hits[$item]++;
            }
        }

        return $this->sorted;
    }
709164
public function sortByEndDate()
	{
		uksort( $this->contexts, function( $a, $b ) use ( &$contexts )
		{
			return -1 * strcmp( $this->contexts[ $a] ['period']['endDate'], $this->contexts[ $b]['period']['endDate'] );
		} );

		return $this;
	}
1024887
public function reverse() {
		if (preg_match_all('/./us', $this->rawString, $matches)) {
			$rawString = join('', array_reverse($matches[0]));

			return new static($rawString, $this->charset);
		}
		else {
			return $this;
		}
	}
984804
public function index()
    {
        //Gets all log files, except those serialized
        $logs = collection((new Folder(LOGS))->find('(?!.*_serialized).+\.log'))
            ->map(function ($log) {
                return new Entity([
                    'filename' => $log,
                    'hasSerialized' => is_readable($this->getPath($log, true)),
                    'size' => filesize(LOGS . $log),
                ]);
            });

        $this->set(compact('logs'));
    }
585637
public function sort()
    {
        $values = $this->toArray();
        ksort($values);
        
        $this->clear();
        
        foreach($values as $index => $value) {
            $this->set($index,$value);
        }
        
        return $this;
    }
112064
private function _sortDirection()
    {
        $collection = ResourceTable::collection();
        $sort = $collection->getSort();

        return $sort['dir'] ? $sort['dir'] : ResourceTable::DEFAULT_SORT_DIR;
    }
216346
public function getListSorting()
    {
        if ($this->_aCurrSorting === null) {
            $this->_aCurrSorting = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('sort');

            if (!$this->_aCurrSorting && $this->_sDefSortField && ($baseObject = $this->getItemListBaseObject())) {
                $this->_aCurrSorting[$baseObject->getCoreTableName()] = [$this->_sDefSortField => "asc"];
            }
        }

        return $this->_aCurrSorting;
    }
850207
public function reverse()
    {
        $length = count($this->store);
        for ($i = 0; $i < $length; ++$i) {
            $this->store->unshift($this->store->pop());
        }
    }