src/Charcoal/Source/Order.php
public function setDirection($direction)
    {
        if ($direction === null) {
            $this->direction = $direction;
            return $this;
        }

        if (!is_string($direction)) {
            throw new InvalidArgumentException(
                'Direction must be a string.'
            );
        }

        $this->direction = strtolower($direction) === 'asc' ? 'ASC' : 'DESC';
        return $this;
    }
public function setDirection($direction)
    {
        if ($direction === null) {
            $this->direction = $direction;
            return $this;
        }

        if (!is_string($direction)) {
            throw new InvalidArgumentException(
                'Direction must be a string.'
            );
        }

        $this->direction = strtolower($direction) === 'asc' ? 'ASC' : 'DESC';
        return $this;
    }
public function setDirection ( $ direction ) { if ( $ direction === null ) { $ this -> direction = $ direction ; return $ this ; } if ( ! is_string ( $ direction ) ) { throw new InvalidArgumentException ( 'Direction must be a string.' ) ; } $ this -> direction = strtolower ( $ direction ) === 'asc' ? 'ASC' : 'DESC' ; return $ this ; }
Set the sorting direction.

@param  string|null $direction The direction to sort on.
@throws InvalidArgumentException If the direction is not a string.
@return self
Set the sorting direction .