1: <?php
2: /**
3: * PHP version 5
4: *
5: * @package generalDriver
6: * @author Christian Schiffler <c.schiffler@cyberspectrum.de>
7: * @author Stefan Heimes <stefan_heimes@hotmail.com>
8: * @author Tristan Lins <tristan.lins@bit3.de>
9: * @copyright The MetaModels team.
10: * @license LGPL.
11: * @filesource
12: */
13:
14: namespace DcGeneral\DataDefinition\Definition\View;
15:
16: /**
17: * Interface CommandCollectionInterface.
18: *
19: * This interface describes a collection of commands.
20: *
21: * @package DcGeneral\DataDefinition\Definition\View
22: */
23: interface CommandCollectionInterface
24: {
25: /**
26: * Remove all commands from this collection.
27: *
28: * @return CommandCollectionInterface
29: */
30: public function clearCommands();
31:
32: /**
33: * Set the commands of this collection.
34: *
35: * @param CommandInterface[]|array $commands The commands that shall be contained within the collection.
36: *
37: * @return CommandCollectionInterface
38: */
39: public function setCommands(array $commands);
40:
41: /**
42: * Add commands to this collection.
43: *
44: * @param CommandInterface[]|array $commands The commands that shall be added to the collection.
45: *
46: * @return CommandCollectionInterface
47: */
48: public function addCommands(array $commands);
49:
50: /**
51: * Remove commands from this collection.
52: *
53: * @param CommandInterface[]|array $commands The commands that shall be removed from the collection.
54: *
55: * @return CommandCollectionInterface
56: */
57: public function removeCommands(array $commands);
58:
59: /**
60: * Check if the command exists in this collection.
61: *
62: * @param CommandInterface $command The command instance to search for.
63: *
64: * @return bool
65: */
66: public function hasCommand(CommandInterface $command);
67:
68: /**
69: * Check if the command with a given name exists in this collection.
70: *
71: * @param string $name The command name to search.
72: *
73: * @return bool
74: */
75: public function hasCommandNamed($name);
76:
77: /**
78: * Add an command to this collection.
79: *
80: * @param CommandInterface $command The command to add.
81: *
82: * @return CommandCollectionInterface
83: */
84: public function addCommand(CommandInterface $command);
85:
86: /**
87: * Remove an command from this collection.
88: *
89: * @param CommandInterface $command The command to remove.
90: *
91: * @return CommandCollectionInterface
92: */
93: public function removeCommand(CommandInterface $command);
94:
95: /**
96: * Remove an command with given name from this collection.
97: *
98: * @param string $name The command name to remove.
99: *
100: * @return CommandCollectionInterface
101: */
102: public function removeCommandNamed($name);
103:
104: /**
105: * Get command with given name from this collection.
106: *
107: * @param string $name The command name to search.
108: *
109: * @return CommandInterface
110: *
111: * @throws \DcGeneral\Exception\DcGeneralInvalidArgumentException If no command was found.
112: */
113: public function getCommandNamed($name);
114:
115: /**
116: * Get commands from this collection.
117: *
118: * @return CommandInterface[]|array
119: */
120: public function getCommands();
121: }
122: