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: * Class Command.
18: *
19: * Implementation about a command definition.
20: *
21: * @package DcGeneral\DataDefinition\Definition\View
22: */
23: class Command implements CommandInterface
24: {
25: /**
26: * Name of the command.
27: *
28: * @var string
29: */
30: protected $name;
31:
32: /**
33: * The parameters for the command.
34: *
35: * @var \ArrayObject
36: */
37: protected $parameters;
38:
39: /**
40: * The label string for the command.
41: *
42: * @var string
43: */
44: protected $label;
45:
46: /**
47: * The description text for the command.
48: *
49: * @var string
50: */
51: protected $description;
52:
53: /**
54: * The extra data for the command.
55: *
56: * @var \ArrayObject
57: */
58: protected $extra;
59:
60: /**
61: * Flag if the command is disabled or not.
62: *
63: * @var bool
64: */
65: protected $disabled;
66:
67: /**
68: * Create a new instance.
69: */
70: public function __construct()
71: {
72: $this->parameters = new \ArrayObject();
73: $this->extra = new \ArrayObject();
74: }
75:
76: /**
77: * {@inheritdoc}
78: */
79: public function setName($name)
80: {
81: $this->name = (string)$name;
82:
83: return $this;
84: }
85:
86: /**
87: * {@inheritdoc}
88: */
89: public function getName()
90: {
91: return $this->name;
92: }
93:
94: /**
95: * {@inheritdoc}
96: */
97: public function setParameters(\ArrayObject $parameters)
98: {
99: $this->parameters = $parameters;
100:
101: return $this;
102: }
103:
104: /**
105: * {@inheritdoc}
106: */
107: public function getParameters()
108: {
109: return $this->parameters;
110: }
111:
112: /**
113: * {@inheritdoc}
114: */
115: public function setLabel($label)
116: {
117: $this->label = (string)$label;
118:
119: return $this;
120: }
121:
122: /**
123: * {@inheritdoc}
124: */
125: public function getLabel()
126: {
127: return $this->label;
128: }
129:
130: /**
131: * {@inheritdoc}
132: */
133: public function setDescription($description)
134: {
135: $this->description = (string)$description;
136:
137: return $this;
138: }
139:
140: /**
141: * {@inheritdoc}
142: */
143: public function getDescription()
144: {
145: return $this->description;
146: }
147:
148: /**
149: * {@inheritdoc}
150: */
151: public function setExtra(\ArrayObject $extra)
152: {
153: $this->extra = $extra;
154:
155: return $this;
156: }
157:
158: /**
159: * {@inheritdoc}
160: */
161: public function getExtra()
162: {
163: return $this->extra;
164: }
165:
166: /**
167: * {@inheritdoc}
168: */
169: public function setDisabled($disabled = true)
170: {
171: $this->disabled = $disabled;
172:
173: return $this;
174: }
175:
176: /**
177: * {@inheritdoc}
178: */
179: public function isDisabled()
180: {
181: return $this->disabled;
182: }
183: }
184: