You are here

function workflow_debug in Workflow 8

Same name and namespace in other branches
  1. 7.2 workflow.module \workflow_debug()

Helper function for D8-port: Get some info on screen.

Usage: workflow_debug(__FILE__, __FUNCTION__, __LINE__, '', '');

Parameters

string $class_name:

string $function_name:

string $line_nr:

string $value1:

string $value2:

See also

workflow_devel-module

26 calls to workflow_debug()
hook_copy_form_values_to_transition_field_alter in ./workflow.api.php
Implements hook_copy_form_values_to_transition_field_alter().
hook_field_widget_workflow_default_form_alter in ./workflow.api.php
WorkflowAccessControlHandler::checkCreateAccess in src/WorkflowAccessControlHandler.php
Performs create access checks.
WorkflowAccessControlHandler::createAccess in src/WorkflowAccessControlHandler.php
Checks access to create an entity.
WorkflowScheduledTransition::save in src/Entity/WorkflowScheduledTransition.php
Saves a scheduled transition. If the transition is executed, save in history.

... See full list

File

./workflow.devel.inc, line 24
Includes a helper function for debug/devel purposes.

Code

function workflow_debug($class_name, $function_name, $line_nr = '', $value1 = '', $value2 = '') {
  $debug_switch = FALSE;

  // $debug_switch = TRUE;
  if (!$debug_switch) {
    return;
  }
  $class_name_elements = explode("\\", $class_name);
  $output = 'Testing... function ' . end($class_name_elements) . '::' . $function_name . '/' . $line_nr;
  if ($value1) {
    $output .= ' = ' . $value1;
  }
  if ($value2) {
    $output .= ' > ' . $value2;
  }
  \Drupal::messenger()
    ->addWarning($output, TRUE);
}