1: <?php
2: /**
3: * PHP version 5
4: * @package generalDriver
5: * @author Christian Schiffler <c.schiffler@cyberspectrum.de>
6: * @author Stefan Heimes <stefan_heimes@hotmail.com>
7: * @author Tristan Lins <tristan.lins@bit3.de>
8: * @copyright The MetaModels team.
9: * @license LGPL.
10: * @filesource
11: */
12:
13: namespace DcGeneral\DataDefinition;
14:
15: use DcGeneral\DataDefinition\Definition\ModelRelationshipDefinitionInterface;
16: use DcGeneral\DataDefinition\Definition\BasicDefinitionInterface;
17: use DcGeneral\DataDefinition\Definition\DefinitionInterface;
18: use DcGeneral\DataDefinition\Definition\DataProviderDefinitionInterface;
19: use DcGeneral\DataDefinition\Definition\PalettesDefinitionInterface;
20: use DcGeneral\DataDefinition\Definition\PropertiesDefinitionInterface;
21:
22: /**
23: * This interface is the base of a data definition.
24: *
25: * Within this interface, all the information about a data definition is to be found.
26: *
27: * Most commonly used definitions have their getter and setter defined in this interface, for those definitions that
28: * are not so common, please use the generic getter and setter using names.
29: *
30: * @package DcGeneral\DataDefinition
31: */
32: interface ContainerInterface
33: {
34: /**
35: * Return the name of the container.
36: *
37: * @return string
38: */
39: public function getName();
40:
41: /**
42: * Check if this container has a definition.
43: *
44: * @param string $definitionName The name of the definition to check for.
45: *
46: * @return bool
47: */
48: public function hasDefinition($definitionName);
49:
50: /**
51: * Clear all definitions from this container.
52: *
53: * @return ContainerInterface
54: */
55: public function clearDefinitions();
56:
57: /**
58: * Set the definitions of this container.
59: *
60: * @param array|DefinitionInterface[] $definitions The definitons.
61: *
62: * @return ContainerInterface
63: */
64: public function setDefinitions(array $definitions);
65:
66: /**
67: * Add multiple definitions to this container.
68: *
69: * @param array|DefinitionInterface[] $definitions The definitons.
70: *
71: * @return ContainerInterface
72: */
73: public function addDefinitions(array $definitions);
74:
75: /**
76: * Set a definitions of this container.
77: *
78: * @param string $definitionName The name of the definition.
79: *
80: * @param DefinitionInterface $definition The definition.
81: *
82: * @return ContainerInterface
83: */
84: public function setDefinition($definitionName, DefinitionInterface $definition);
85:
86: /**
87: * Remove a definitions from this container.
88: *
89: * @param string $definitionName The name of the definition.
90: *
91: * @return ContainerInterface
92: */
93: public function removeDefinition($definitionName);
94:
95: /**
96: * Get a definitions of this container.
97: *
98: * @param string $definitionName The name of the definition.
99: *
100: * @return DefinitionInterface
101: */
102: public function getDefinition($definitionName);
103:
104: /**
105: * Get a list of all definition names in this container.
106: *
107: * @return array
108: */
109: public function getDefinitionNames();
110:
111: /**
112: * Convenience method to check if a basic definition is contained.
113: *
114: * @return BasicDefinitionInterface
115: */
116: public function hasBasicDefinition();
117:
118: /**
119: * Convenience method to set the basic definition.
120: *
121: * @param BasicDefinitionInterface $basicDefinition The basic definition to use.
122: *
123: * @return ContainerInterface
124: */
125: public function setBasicDefinition(BasicDefinitionInterface $basicDefinition);
126:
127: /**
128: * Convenience method to retrieve the basic definition.
129: *
130: * @return BasicDefinitionInterface
131: */
132: public function getBasicDefinition();
133:
134: /**
135: * Convenience method to check if there has been a properties definition defined.
136: *
137: * @return bool
138: */
139: public function hasPropertiesDefinition();
140:
141: /**
142: * Convenience method to set the properties definition to use.
143: *
144: * @param PropertiesDefinitionInterface $propertiesDefinition The properties definition to use.
145: *
146: * @return ContainerInterface
147: */
148: public function setPropertiesDefinition(PropertiesDefinitionInterface $propertiesDefinition);
149:
150: /**
151: * Convenience method to retrieve the properties definition to use.
152: *
153: * @return PropertiesDefinitionInterface
154: */
155: public function getPropertiesDefinition();
156:
157: /**
158: * Convenience method to check if there has been a palettes definition defined.
159: *
160: * @return bool
161: */
162: public function hasPalettesDefinition();
163:
164: /**
165: * Convenience method to set the palettes definition to use.
166: *
167: * @param PalettesDefinitionInterface $palettesDefinition The palettes definition to use.
168: *
169: * @return ContainerInterface
170: */
171: public function setPalettesDefinition(PalettesDefinitionInterface $palettesDefinition);
172:
173: /**
174: * Convenience method to retrieve the palettes definition to use.
175: *
176: * @return PalettesDefinitionInterface
177: */
178: public function getPalettesDefinition();
179:
180: /**
181: * Convenience method to check if a data provider definition is contained.
182: *
183: * @return bool
184: */
185: public function hasDataProviderDefinition();
186:
187: /**
188: * Convenience method to set the data provider definition.
189: *
190: * @param DataProviderDefinitionInterface $dataProviderDefinition The data provider definition to use.
191: *
192: * @return ContainerInterface
193: */
194: public function setDataProviderDefinition(DataProviderDefinitionInterface $dataProviderDefinition);
195:
196: /**
197: * Convenience method to retrieve the data provider definition.
198: *
199: * @return DataProviderDefinitionInterface
200: */
201: public function getDataProviderDefinition();
202:
203: /**
204: * Convenience method to check if a data provider definition is contained.
205: *
206: * @return bool
207: */
208: public function hasModelRelationshipDefinition();
209:
210: /**
211: * Convenience method to set the data provider definition.
212: *
213: * @param ModelRelationshipDefinitionInterface $definition The model relationship definition to use.
214: *
215: * @return ContainerInterface
216: */
217: public function setModelRelationshipDefinition(ModelRelationshipDefinitionInterface $definition);
218:
219: /**
220: * Convenience method to retrieve the data provider definition.
221: *
222: * @return ModelRelationshipDefinitionInterface
223: */
224: public function getModelRelationshipDefinition();
225: }
226: