blob: 3d96cb35c7eb34c31b2099427ae8c3f3f23b1a8f [file] [log] [blame]
<?php
namespace BaclucEventPackage;
use BaclucC5Crud\Controller\ActionProcessor;
use BaclucC5Crud\Controller\ActionRegistry;
use BaclucC5Crud\Controller\ActionRegistryFactory;
use BaclucEventPackage\NextEvent\ShowNextEvent;
class EventActionRegistryFactory
{
const SHOW_NEXT_EVENT = "show_next_event";
const SHOW_CANCEL_EVENT_FORM = "show_cancel_event_form";
/**
* @var ActionProcessor[]
*/
private $actions;
public function __construct(
ActionRegistryFactory $actionRegistryFactory,
ShowNextEvent $showNextEvent,
ShowCancelEventForm $showCancelEventForm,
PostCancelEventForm $postCancelEventForm
) {
$this->actions = $actionRegistryFactory->createActionRegistry()->getActions();
$this->actions[] = $showNextEvent;
$this->actions[] = $showCancelEventForm;
$this->actions[] = $postCancelEventForm;
}
public function createActionRegistry(): ActionRegistry
{
return new ActionRegistry($this->actions);
}
}