public function sort($sort)
    {
        if (null !== $sort && !is_array($sort)) {
            throw new \InvalidArgumentException(sprintf('The sort "%s" is not valid.', $sort));
        }

        $this->sort = $sort;

        return $this;
    }
public function sort($sort)
    {
        if (null !== $sort && !is_array($sort)) {
            throw new \InvalidArgumentException(sprintf('The sort "%s" is not valid.', $sort));
        }

        $this->sort = $sort;

        return $this;
    }
public function sort ( $ sort ) { if ( null !== $ sort && ! is_array ( $ sort ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The sort "%s" is not valid.' , $ sort ) ) ; } $ this -> sort = $ sort ; return $ this ; }
Set the sort.

@param array|null $sort The sort.

@return \Mandango\Query The query instance (fluent interface).

@throws \InvalidArgumentException If the sort is not an array or null.

@api
Set the sort .