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
/**
* 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);
}