LdapTools\Query\LdapQuery::setOrderBy PHP Method

setOrderBy() public method

Set the attributes to order the results by.
public setOrderBy ( array $orderBy )
$orderBy array In the form of ['attribute' => 'ASC', ...]
    public function setOrderBy(array $orderBy)
    {
        // Validate and force the case for the direction.
        foreach ($orderBy as $attribute => $direction) {
            if (!in_array(strtoupper($direction), self::ORDER)) {
                throw new \InvalidArgumentException(sprintf('Order direction "%s" is invalid. Valid values are ASC and DESC', $direction));
            }
            $orderBy[$attribute] = strtoupper($direction);
        }
        $this->orderBy = $orderBy;
        return $this;
    }