FezPost
final class FezPost : Model, Searchable
extension FezPost: ContentFilterable
extension FezPost: Reportable
An individual post within a FriendlyFez
discussion. A FezPost must contain
text content and may also contain image content, unless the Fez is of type FezType.closed
,
in which case the post may not contain images.
See
See Also: FezPostData the DTO for returning info on FezPosts. FezPostData is also a member ofFezData
.
See
See Also: CreateFezPostSchema the Migration for creating the FezPost table in the database.-
Declaration
Swift
static let schema: String
-
The post’s ID.
Declaration
Swift
@ID var id: Int?
-
The text content of the post.
Declaration
Swift
@Field var text: String
-
The filename of any image content of the post. FezPosts are limited to one image, and “closed” Fez types cannot have any.
Declaration
Swift
@OptionalField var image: String?
-
Moderators can set several statuses on fezPosts that modify editability and visibility.
Declaration
Swift
@Enum var moderationStatus: ContentModerationStatus
-
Timestamp of the model’s creation, set automatically.
Declaration
Swift
@Timestamp var createdAt: Date?
-
Timestamp of the model’s last update, set automatically.
Declaration
Swift
@Timestamp var updatedAt: Date?
-
Timestamp of the model’s soft-deletion, set automatically.
Declaration
Swift
@Timestamp var deletedAt: Date?
-
The
FriendlyFez
to which the post belongs.Declaration
Swift
@Parent var fez: FriendlyFez
-
The post’s author.
Declaration
Swift
@Parent var author: User
-
Used by Fluent
Declaration
Swift
init()
-
Initializes a new FezPost.
Declaration
Swift
init( fez: FriendlyFez, authorID: UUID, text: String, image: String? ) throws
Parameters
fezID
The ID of the post’s FriendlyFez.
authorID
The ID of the author of the post.
text
The text content of the post.
image
The filename of any image content of the post.
-
Declaration
Swift
func contentTextStrings() -> [String]
-
The report type for
FezPost
reports.Declaration
Swift
var reportType: ReportType { get }
-
Standardizes how to get the author ID of a Reportable object.
Declaration
Swift
var authorUUID: UUID { get }
-
No auto quarantine for fez posts.
Declaration
Swift
var autoQuarantineThreshold: Int { get }