ActionGroup now implements Countable interface.

This commit is contained in:
Vassyli
2018-04-12 19:49:10 +02:00
parent 2a0bf5f038
commit ccfb432e4d
2 changed files with 11 additions and 1 deletions
+10 -1
View File
@@ -6,7 +6,7 @@ namespace LotGD\Core;
/**
* A grouping of navigation actions, like a submenu.
*/
class ActionGroup
class ActionGroup implements \Countable
{
const DefaultGroup = 'lotgd/core/default';
const HiddenGroup = 'lotgd/core/hidden';
@@ -30,6 +30,15 @@ class ActionGroup
$this->actions = [];
}
/**
* Returns the number of registered Actions for this group.
* @return int
*/
public function count(): int
{
return count($this->actions);
}
/**
* Returns the unique identifier for this group, in the vendor/module/group format.
* @return string
+1
View File
@@ -4,6 +4,7 @@ declare (strict_types=1);
namespace LotGD\Core;
use DateTime;
use Doctrine\Common\Util\Debug;
use Doctrine\ORM\EntityManagerInterface;
use LotGD\Core\Events\NavigateToSceneData;
use LotGD\Core\Events\NewViewpointData;