Category
final class Category : ModelCategories are used to organize Twit-arr Forums into a managable structure. All Forums
belong to a single Category.
Each Category has a minimum userAccessLevel required to view the Category or view forums in the Category.
Each Category also has a minimum userAccessLevel required to create new forums in the Category.
See
See Also: CategoryData the DTO for returning info on Categories.See
See Also: CreateCategorySchema the Migration for creating the Category table in the database.- 
                  
                  DeclarationSwift static let schema: String
- 
                  
                  The category’s ID. DeclarationSwift @ID var id: UUID?
- 
                  
                  The title of the category. DeclarationSwift @Field var title: String
- 
                  
                  A short string describing what the Category is for. Color commentary for the category. DeclarationSwift @Field var purpose: String
- 
                  
                  TRUE if this category holds forums for Events. DeclarationSwift @Field var isEventCategory: Bool
- 
                  
                  Minimum access level to view posts in this category. Usually set to .quarantined. But, a category reserved for moderators only could have this set to.moderator.DeclarationSwift @Enum var accessLevelToView: UserAccessLevel
- 
                  
                  Minimum access level to create threads in this category. Usually set to .verified. Setting this to a value less than verified won’t work as those users cannot create any content. This setting does not govern posting in existing threads. An admin could create a thread in an admin-only forum and leave it unlocked so that anyone that can see the thread can post in it. Or, they could lock the thread, preventing posting.DeclarationSwift @Enum var accessLevelToCreate: UserAccessLevel
- 
                  
                  If non-nil, the UserRoleType that a User is required to posess in order to view items in this category. This test is bypassed for Moderator users. For everyone else, both the Role test and the accessLevel test must pass in order to view. DeclarationSwift @OptionalEnum var requiredRole: UserRoleType?
- 
                  
                  The number of forums containted in this Category. Should always be equal to forums.count. DeclarationSwift @Field var forumCount: Int32
- 
                  
                  Timestamp of the model’s creation, set automatically. DeclarationSwift @Timestamp var createdAt: Date?
- 
                  
                  Timestamp of the model’s last update, set automatically. DeclarationSwift @Timestamp var updatedAt: Date?
- 
                  
                  Timestamp of the model’s soft-deletion, set automatically. DeclarationSwift @Timestamp var deletedAt: Date?
- 
                  
                  DeclarationSwift init()
- 
                  
                  Initializes a new Category. DeclarationSwift init( title: String, purpose: String, viewAccess: UserAccessLevel = .quarantined, createForumAccess: UserAccessLevel = .verified, isEventCategory: Bool = false, requiredRole: UserRoleType? = nil )ParameterstitleThe title for the the category. isRestrictedWhether users can create forums in the category. 
 View on GitHub
            View on GitHub
           Category Class Reference
      Category Class Reference