You are here

public function Workflow::save in Workflow 8

Given information, update or insert a new workflow.

This also handles importing, rebuilding, reverting from Features, as defined in workflow.features.inc.

@todo D8: Clean up this function, since we are config entity now.

When changing this function, test with the following situations:

  • maintain Workflow in Admin UI;
  • clone Workflow in Admin UI;
  • create/revert/rebuild Workflow with Features; - save Workflow programmatically;

@inheritdoc

Overrides ConfigEntityBase::save

See also

workflow.features.inc

File

src/Entity/Workflow.php, line 137

Class

Workflow
Workflow configuration entity to persistently store configuration.

Namespace

Drupal\workflow\Entity

Code

public function save() {
  $status = parent::save();

  // Make sure a Creation state exists, when saving a Workflow.
  if ($status == SAVED_NEW) {
    $this
      ->getCreationState();
  }
  return $status;
}