• Full name: \App\Infrastructure\Services\Content\Workflow\ContentWorkflowService
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Properties

dfdb

private \Qubus\Expressive\Database $dfdb

Methods

__construct

public __construct(\Qubus\Expressive\Database $dfdb): mixed

Parameters:

Parameter Type Description
$dfdb \Qubus\Expressive\Database

requestReview

public requestReview(string $contentId, string $userId, array $reviewers, string $message = ''): array

Parameters:

Parameter Type Description
$contentId string
$userId string
$reviewers array
$message string

Throws:


assignReviewers

public assignReviewers(string $contentId, string $userId, array $reviewers): array

Parameters:

Parameter Type Description
$contentId string
$userId string
$reviewers array

Throws:


approve

public approve(string $contentId, string $userId, string $message = ''): array

Parameters:

Parameter Type Description
$contentId string
$userId string
$message string

Throws:


requestChanges

public requestChanges(string $contentId, string $userId, string $message = ''): array

Parameters:

Parameter Type Description
$contentId string
$userId string
$message string

Throws:


publish

public publish(string $contentId, string $userId, string $message = ''): array

Parameters:

Parameter Type Description
$contentId string
$userId string
$message string

Throws:


completeReview

public completeReview(string $contentId, string $userId, string $message = ''): array

Parameters:

Parameter Type Description
$contentId string
$userId string
$message string

Throws:


reviewerCandidates

public reviewerCandidates(): array

Throws:


reviewerNames

public reviewerNames(array $reviewerIds, array $reviewerStatus = []): array

Parameters:

Parameter Type Description
$reviewerIds array
$reviewerStatus array

comment

public comment(string $contentId, string $userId, string $body, string|null $parentId = null, array|null $selection = null, string $type = 'editorial'): array

Parameters:

Parameter Type Description
$contentId string
$userId string
$body string
$parentId string|null
$selection array|null
$type string

Throws:


publishScheduled

public publishScheduled(string $contentId): array

Parameters:

Parameter Type Description
$contentId string

Throws:


withdrawReview

public withdrawReview(string $contentId, string $userId, string $message = ''): array

Parameters:

Parameter Type Description
$contentId string
$userId string
$message string

Throws:


activity

public activity(string $contentId, int $limit = 25): array

Parameters:

Parameter Type Description
$contentId string
$limit int

Throws:


comments

public comments(string $contentId, string $status = 'open'): array

Parameters:

Parameter Type Description
$contentId string
$status string

Throws:


content

private content(string $contentId): array

Parameters:

Parameter Type Description
$contentId string

Throws:


attribute

private attribute(?string $json = null): array

Parameters:

Parameter Type Description
$json ?string

Throws:


updateContent

private updateContent(string $contentId, string $status, array $attribute): void

Parameters:

Parameter Type Description
$contentId string
$status string
$attribute array

Throws:


updateComment

public updateComment(string $commentId, string $userId, string $body): array

Parameters:

Parameter Type Description
$commentId string
$userId string
$body string

Throws:


replyToComment

public replyToComment(string $contentId, string $userId, string $parentId, string $body): array

Parameters:

Parameter Type Description
$contentId string
$userId string
$parentId string
$body string

Throws:


resolveComment

public resolveComment(string $commentId, string $userId): void

Parameters:

Parameter Type Description
$commentId string
$userId string

Throws:


reopenComment

public reopenComment(string $commentId, string $userId): void

Parameters:

Parameter Type Description
$commentId string
$userId string

Throws:


deleteComment

public deleteComment(string $commentId, string $userId): void

Parameters:

Parameter Type Description
$commentId string
$userId string

Throws:


commentSummary

public commentSummary(string $contentId): int[]

Parameters:

Parameter Type Description
$contentId string

Throws:


resolveOpenChildComments

private resolveOpenChildComments(string $parentId, string $resolvedAt): int

Parameters:

Parameter Type Description
$parentId string
$resolvedAt string

commentById

private commentById(string $commentId): array

Parameters:

Parameter Type Description
$commentId string

nestComments

private nestComments(array $rows): array

Parameters:

Parameter Type Description
$rows array

log

private log(string $contentId, string $userId, string $type, ?string $fromStatus = null, ?string $toStatus = null, string $message = '', array $metadata = []): string

Parameters:

Parameter Type Description
$contentId string
$userId string
$type string
$fromStatus ?string
$toStatus ?string
$message string
$metadata array

Throws:


notifyMany

private notifyMany(string $contentId, array $userIds, string $activityId, string $type, string $title, string $body = ''): void

Parameters:

Parameter Type Description
$contentId string
$userIds array
$activityId string
$type string
$title string
$body string

Throws:


defaultEditorialUserIds

private defaultEditorialUserIds(?string $excludeUserId = null): array

Parameters:

Parameter Type Description
$excludeUserId ?string

normalizeReviewerStatus

private normalizeReviewerStatus(array $reviewers, array $existing = []): array

Parameters:

Parameter Type Description
$reviewers array
$existing array

allReviewersComplete

private allReviewersComplete(array $reviewers, array $reviewerStatus): bool

Parameters:

Parameter Type Description
$reviewers array
$reviewerStatus array

assertWorkflowStage

private assertWorkflowStage(array $workflow, array|string $allowedStages): void

Parameters:

Parameter Type Description
$workflow array
$allowedStages array|string

Throws:


assertContentStatus

private assertContentStatus(array $content, array|string $allowedStatuses): void

Parameters:

Parameter Type Description
$content array
$allowedStatuses array|string

Throws:


assertCan

private assertCan(string $permission): void

Parameters:

Parameter Type Description
$permission string

Throws:


now

private now(): string

queueEmailNotifications

private queueEmailNotifications(string $contentId, array $userIds, string $title, string $message, string $type = 'Editorial Workflow', string $anchor = 'content-workflow-box'): void

Parameters:

Parameter Type Description
$contentId string
$userIds array
$title string
$message string
$type string
$anchor string

Throws:


notifyCommentUsers

private notifyCommentUsers(string $contentId, string $actorUserId, string $activityId, string $body, string|null $parentId = null): void

Parameters:

Parameter Type Description
$contentId string
$actorUserId string
$activityId string
$body string
$parentId string|null

Throws: