Back to WorkflowPluginTrait class

Method checkExtensionSupport

protected bool
checkExtensionSupport
(mixed $context, mixed $functionality)
Check if the context supports a specific functionality.
Parameters
  • string $context Context to check
  • string $functionality The functionality
Returns
  • bool

Method checkExtensionSupport - Source code

/**
 * Check if the context supports a specific functionality.
 *
 * @param   string  $context       Context to check
 * @param   string  $functionality The functionality
 *
 * @return  boolean
 */
protected function checkExtensionSupport($context, $functionality)
{
    $parts = explode('.', $context);
    $component = $this->app->bootComponent($parts[0]);
    if (!$component instanceof WorkflowServiceInterface || !$component->isWorkflowActive($context) || !$component->supportFunctionality($functionality, $context)) {
        return false;
    }
    return true;
}