Back to WorkflowServiceTrait class

Method supportFunctionality

public bool
supportFunctionality
(mixed $functionality, mixed $context)
Check if the functionality is supported by the component The variable $supportFunctionality has the following structure [ 'core.featured' => [ 'com_content.article', ], 'core.state' => [ 'com_content.article', ], ]
Parameters
  • string $functionality The functionality
  • string $context The context of the functionality
Returns
  • bool

Method supportFunctionality - Source code

/**
 * Check if the functionality is supported by the component
 * The variable $supportFunctionality has the following structure
 * [
 *   'core.featured' => [
 *     'com_content.article',
 *   ],
 *   'core.state' => [
 *     'com_content.article',
 *   ],
 * ]
 *
 * @param   string  $functionality  The functionality
 * @param   string  $context        The context of the functionality
 *
 * @return boolean
 */
public function supportFunctionality($functionality, $context) : bool
{
    if (empty($this->supportedFunctionality[$functionality])) {
        return false;
    }
    if (!is_array($this->supportedFunctionality[$functionality])) {
        return true;
    }
    return in_array($context, $this->supportedFunctionality[$functionality], true);
}