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 of FezData.

See

See Also: CreateFezPostSchema the Migration for creating the FezPost table in the database.

Properties

  • id

    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?

Relations

Initialization

  • 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.

Functions