system/classes/Collection.php
public function sort2($key = false, $dir = 'desc')
    {
        if ($this->contentModified) {
            $this->generateContent();
        }
        $this->sortDirection = $dir;
        $this->sortKey = $key;
        $temp = $this->msort(array_values($this->content));
        return new self($temp);
    }
public function sort2($key = false, $dir = 'desc')
    {
        if ($this->contentModified) {
            $this->generateContent();
        }
        $this->sortDirection = $dir;
        $this->sortKey = $key;
        $temp = $this->msort(array_values($this->content));
        return new self($temp);
    }
Sorts the contents of this Container.

@param key The key on which to sort.
@param dir The sort direction.
@return A reference to this Container.