Tailor\Traits\DraftableModel

Overview

DraftableModel trait allows draft versions of models


Protected Properties

protected string|null $draftableSaveMode

draftableSaveMode for saving the draft.

protected array $draftableSaveAttrs

draftableSaveAttrs contains draft notes.


Public Methods

public static bootDraftableModel()

public static bootDraftableModel(): void

bootDraftableModel trait for a model.

public countDrafts()

public countDrafts(): int 

countDrafts will return the number of available drafts.

public createNewDraft()

public createNewDraft($attrs = []): void

public getDraftId()

public getDraftId(): string 

public getDraftModeColumn()

public getDraftModeColumn(): int 

getDraftModeColumn returns the value of the draft column.

public getDraftModeColumnName()

public getDraftModeColumnName(): string 

getDraftModeColumnName gets the name of the "draft_mode" column.

public getDraftName()

public getDraftName(): string 

public getDraftNotes()

public getDraftNotes(): string 

public getDraftRecords()

public getDraftRecords(): void

public getQualifiedDraftModeColumnName()

public getQualifiedDraftModeColumnName(): string 

getQualifiedDraftModeColumnName gets the fully qualified "draft_mode" column.

public initializeDraftableModel()

public initializeDraftableModel(): void

public isDraftStatus()

public isDraftStatus(): bool 

public isFirstDraftStatus()

public isFirstDraftStatus(): bool 

public isUnsavedDraftStatus()

public isUnsavedDraftStatus(): bool 

public saveAsFirstDraft()

public saveAsFirstDraft($attrs = []): void

public setDraftAutosave()

public setDraftAutosave($attrs): void 

public setDraftCommit()

public setDraftCommit($attrs): void 

public setDraftPublish()

public setDraftPublish(): void