You are here

public function Workflow::isDeletable in Workflow 8

Returns if the Workflow may be deleted.

Return value

bool TRUE if a Workflow may safely be deleted.

Overrides WorkflowInterface::isDeletable

1 call to Workflow::isDeletable()
Workflow::delete in src/Entity/Workflow.php
Given a wid, delete the workflow and its data.

File

src/Entity/Workflow.php, line 220

Class

Workflow
Workflow configuration entity to persistently store configuration.

Namespace

Drupal\workflow\Entity

Code

public function isDeletable() {

  // May not be deleted if assigned to a Field.
  foreach (_workflow_info_fields() as $field_info) {
    if ($field_info
      ->getSetting('workflow_type') == $this
      ->id()) {
      return FALSE;
    }
  }
  return TRUE;
}