You are here

public function Workflow::status in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/workflows/src/Entity/Workflow.php \Drupal\workflows\Entity\Workflow::status()

Returns whether the configuration entity is enabled.

Status implementations for configuration entities should follow these general rules:

  • Status does not affect the loading of entities. I.e. Disabling configuration entities should only have UI/access implications.
  • It should only take effect when a 'status' key is explicitly declared in the entity_keys info of a configuration entity's annotation data.
  • Each entity implementation (entity/controller) is responsible for checking and managing the status.

Return value

bool Whether the entity is enabled or not.

Overrides ConfigEntityBase::status

File

core/modules/workflows/src/Entity/Workflow.php, line 163

Class

Workflow
Defines the workflow entity.

Namespace

Drupal\workflows\Entity

Code

public function status() {

  // In order for a workflow to be usable it must have at least one state.
  return !empty($this->status) && !empty($this
    ->getTypePlugin()
    ->getStates());
}