Back to WorkflowServiceTrait class

Method getModelName

public bool
getModelName
(mixed $context)
Returns the model name, based on the context
Parameters
  • string $context The context of the workflow
Returns
  • bool
Since
  • 4.0.0

Method getModelName - Source code

/**
 * Returns the model name, based on the context
 *
 * @param   string  $context  The context of the workflow
 *
 * @return boolean
 *
 * @since   4.0.0
 */
public function getModelName($context) : string
{
    $parts = explode('.', $context);
    if (count($parts) < 2) {
        return '';
    }
    array_shift($parts);
    return ucfirst(array_shift($parts));
}