static public function isValid($direction, $throw = false)
    {
        $valid = in_array($direction, [
            static::NONE,
            static::ASC,
            static::DESC,
        ], true);

        if (!$valid && $throw) {
            throw new InvalidArgumentException(sprintf("The direction '%s' is not valid.", $direction));
        }

        return $valid;
    }