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;
    }