You are here

public function WorkflowStateController::delete in Workflow 7.2

Implements EntityAPIControllerInterface.

Parameters

$transaction: Optionally a DatabaseTransaction object to use. Allows overrides to pass in their transaction object.

Overrides EntityAPIController::delete

File

includes/Entity/WorkflowState.php, line 586
Contains workflow\includes\Entity\WorkflowState. Contains workflow\includes\Entity\WorkflowStateController.

Class

WorkflowStateController

Code

public function delete($ids, DatabaseTransaction $transaction = NULL) {

  // @todo: replace with parent.
  foreach ($ids as $id) {
    if ($state = workflow_state_load($id)) {
      $wid = $state->wid;
      db_delete('workflow_states')
        ->condition('sid', $state->sid)
        ->execute();

      // Reset the cache for the affected workflow.
      workflow_reset_cache($wid);
    }
  }
}