1 | <?php |
||
11 | class ActionFactory |
||
12 | { |
||
13 | /** |
||
14 | * @var ArrayCollection |
||
15 | */ |
||
16 | protected $actions; |
||
17 | |||
18 | /** |
||
19 | * Construct |
||
20 | * |
||
21 | * @param array $actions |
||
22 | */ |
||
23 | public function __construct(array $actions = array()) |
||
30 | |||
31 | /** |
||
32 | * Register an action under given name |
||
33 | * |
||
34 | * @param string $name |
||
35 | * @param ActionInterface $action |
||
36 | */ |
||
37 | public function registerAction($name, ActionInterface $action) |
||
41 | |||
42 | /** |
||
43 | * Creates and return a new action under given name |
||
44 | * |
||
45 | * @param string $name |
||
46 | * |
||
47 | * @return ActionInterface |
||
48 | */ |
||
49 | public function createAction($name) |
||
61 | } |
||
62 |