Cleanup: moved HasProvider() out of the Factory

This commit is contained in:
denis.flaven@combodo.com
2023-04-06 14:49:45 +02:00
parent 1982771c28
commit c5640db511
4 changed files with 15 additions and 13 deletions

View File

@@ -21,6 +21,7 @@ namespace Combodo\iTop\Application\UI\Base\Component\PopoverMenu\NewsroomMenu;
use Combodo\iTop\Application\UI\Base\Component\PopoverMenu\PopoverMenu;
use MetaModel;
/**
* Class NewsroomMenu
@@ -65,4 +66,15 @@ class NewsroomMenu extends PopoverMenu
{
return json_encode($this->aParams);
}
/**
* Check if there is any Newsroom provider configured
* @since 3.1.0 N°5619
* @return boolean
*/
public static function HasProviders(): bool
{
$aProviders = MetaModel::EnumPlugins('iNewsroomProvider');
return count($aProviders) > 0;
}
}