You are here

public function WorkflowTransition::__construct in Workflow 8

Creates a new entity.

No arguments passed, when loading from DB. All arguments must be passed, when creating an object programmatically. One argument $entity may be passed, only to directly call delete() afterwards.

Parameters

array $values:

string $entityType: The entity type of this Entity subclass.

bool $bundle:

array $translations:

Overrides ContentEntityBase::__construct

See also

entity_create()

1 call to WorkflowTransition::__construct()
WorkflowScheduledTransition::__construct in src/Entity/WorkflowScheduledTransition.php
@inheritdoc.
1 method overrides WorkflowTransition::__construct()
WorkflowScheduledTransition::__construct in src/Entity/WorkflowScheduledTransition.php
@inheritdoc.

File

src/Entity/WorkflowTransition.php, line 136

Class

WorkflowTransition
Implements an actual, executed, Transition.

Namespace

Drupal\workflow\Entity

Code

public function __construct(array $values = [], $entityType = 'workflow_transition', $bundle = FALSE, array $translations = []) {

  // Please be aware that $entity_type and $entityType are different things!
  parent::__construct($values, $entityType, $bundle, $translations);

  // This transition is not scheduled.
  $this->isScheduled = FALSE;

  // This transition is not executed, if it has no hid, yet, upon load.
  $this->isExecuted = $this
    ->id() > 0;
}