You are here

protected function WorkflowTransition::isEmpty in Workflow 8

Check if anything has changed in this transition.

Return value

bool

3 calls to WorkflowTransition::isEmpty()
WorkflowTransition::execute in src/Entity/WorkflowTransition.php
Execute a transition (change state of an entity).
WorkflowTransition::post_execute in src/Entity/WorkflowTransition.php
Invokes 'transition post'.
WorkflowTransition::save in src/Entity/WorkflowTransition.php
Saves the entity.

File

src/Entity/WorkflowTransition.php, line 355

Class

WorkflowTransition
Implements an actual, executed, Transition.

Namespace

Drupal\workflow\Entity

Code

protected function isEmpty() {
  if ($this
    ->getToSid() != $this
    ->getFromSid()) {
    return FALSE;
  }
  if ($this
    ->getComment()) {
    return FALSE;
  }
  $fields = WorkflowManager::getAttachedFields('workflow_transition', $this
    ->bundle());

  /** @var \Drupal\Core\Field\Entity\BaseFieldOverride $field */
  foreach ($fields as $field_name => $field) {
    if (!$this->{$field_name}
      ->isEmpty()) {
      return FALSE;
    }
  }
  return TRUE;
}