protected function callEventHandler($object, $method)
{
// return true by default (because of transition guard callbacks that
// might not exist)
$output = true;
// check if method exists.
if (method_exists($object, $method)) {
// && $object !== $this) { //prevent recursion
$args = func_get_args();
// remove $object and $method from $args so we only have the other arguments
array_shift($args);
array_shift($args);
// have the methods be able to return what they like
// but make sure the 'onCheckCanTransition method returns a boolean
$output = call_user_func_array(array($object, $method), $args);
}
return $output;
}