3 namespace Drupal\content_moderation\Plugin\WorkflowType;
5 use Drupal\workflows\WorkflowTypeInterface;
8 * Interface for ContentModeration WorkflowType plugin.
10 interface ContentModerationInterface extends WorkflowTypeInterface {
13 * Gets the entity types the workflow is applied to.
16 * The entity types the workflow is applied to.
18 public function getEntityTypes();
21 * Gets any bundles the workflow is applied to for the given entity type.
23 * @param string $entity_type_id
24 * The entity type ID to get the bundles for.
27 * The bundles of the entity type the workflow is applied to or an empty
28 * array if the entity type is not applied to the workflow.
30 public function getBundlesForEntityType($entity_type_id);
33 * Checks if the workflow applies to the supplied entity type and bundle.
35 * @param string $entity_type_id
36 * The entity type ID to check.
37 * @param string $bundle_id
38 * The bundle ID to check.
41 * TRUE if the workflow applies to the supplied entity type ID and bundle
44 public function appliesToEntityTypeAndBundle($entity_type_id, $bundle_id);
47 * Removes an entity type ID / bundle ID from the workflow.
49 * @param string $entity_type_id
50 * The entity type ID to remove.
51 * @param string $bundle_id
52 * The bundle ID to remove.
54 public function removeEntityTypeAndBundle($entity_type_id, $bundle_id);
57 * Add an entity type ID / bundle ID to the workflow.
59 * @param string $entity_type_id
60 * The entity type ID to add. It is responsibility of the caller to provide
61 * a valid entity type ID.
62 * @param string $bundle_id
63 * The bundle ID to add. It is responsibility of the caller to provide a
66 public function addEntityTypeAndBundle($entity_type_id, $bundle_id);
72 * Content Moderation uses this parameter to determine the initial state
73 * based on publishing status.
75 public function getInitialState($entity = NULL);