$workflow_condition_group->
condition($group);
} $query->
condition($workflow_condition_group);
if ($count =
$query->
count()->
execute()) { $message = \Drupal::
translation()->
formatPlural($count, 'The @label workspace can not be published because it contains 1 item in an unpublished moderation state.', 'The @label workspace can not be published because it contains @count items in an unpublished moderation state.',
[ '@label' =>
$workspace->
label(),
]);
$event->
stopPublishing();
$event->
setPublishingStoppedReason((string) $message);
} } /**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array
{ $events[WorkspacePrePublishEvent::
class][] =
['onWorkspacePrePublish'
];
return $events;
}}