Doctrine\ODM\MongoDB\Aggregation\Builder::sort PHP Method

sort() public method

public sort ( $fieldName, $order = null )
    public function sort($fieldName, $order = null)
    {
        $fields = is_array($fieldName) ? $fieldName : [$fieldName => $order];
        return parent::sort($this->getDocumentPersister()->prepareSortOrProjection($fields));
    }