You are here

function WorkflowState::save in Workflow 7

Same name and namespace in other branches
  1. 7.2 includes/Entity/WorkflowState.php \WorkflowState::save()

Save (update/insert) a Workflow State into table workflow_states. @deprecated: workflow_update_workflow_states() --> WorkflowState->save()

1 call to WorkflowState::save()
WorkflowState::deactivate in includes/Entity/WorkflowState.php
Deactivate a Workflow State, moving existing nodes to a given State.

File

includes/Entity/WorkflowState.php, line 143
Contains workflow\includes\Entity\WorkflowState.

Class

WorkflowState
@file Contains workflow\includes\Entity\WorkflowState.

Code

function save() {

  // Convert all properties to an array, the previous ones, too.
  $data['sid'] = $this->sid;
  $data['wid'] = $this->wid;
  $data['weight'] = $this->weight;
  $data['sysid'] = $this->sysid;
  $data['state'] = $this->state;
  $data['status'] = $this->status;
  if (!empty($this->sid) && count(WorkflowState::load($this->sid)) > 0) {
    drupal_write_record('workflow_states', $data, 'sid');
  }
  else {
    drupal_write_record('workflow_states', $data);
  }
}