You are here

public static function Framework::getCallingFunction in Realistic Dummy Content 7.2

Same name and namespace in other branches
  1. 8.2 api/src/Framework/Framework.php \Drupal\realistic_dummy_content_api\Framework\Framework::getCallingFunction()
  2. 3.x api/src/Framework/Framework.php \Drupal\realistic_dummy_content_api\Framework\Framework::getCallingFunction()

Returns the calling function through a backtrace.

File

api/src/Framework/Framework.php, line 362

Class

Framework
The entry point for the framework.

Namespace

Drupal\realistic_dummy_content_api\Framework

Code

public static function getCallingFunction() {

  // A funciton x has called a function y which called this
  // see stackoverflow.com/questions/190421.
  $caller = debug_backtrace();
  $caller = $caller[2];
  return $caller['function'];
}