CategoryModel::castID PHP Method

castID() private static method

Cast a category ID or slug to be passed to the various {@link CategoryCollection} methods.
private static castID ( integer | string | null $category ) : integer | string | null
$category integer | string | null The category ID or slug.
return integer | string | null Returns the cast category ID.
    private static function castID($category)
    {
        if (empty($category)) {
            return null;
        } elseif (is_numeric($category)) {
            return (int) $category;
        } else {
            return (string) $category;
        }
    }