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: * @copyright The MetaModels team.
8: * @license LGPL.
9: * @filesource
10: */
11:
12: namespace DcGeneral\Factory;
13:
14: use ContaoCommunityAlliance\Translator\TranslatorInterface;
15: use DcGeneral\DataDefinition\ContainerInterface;
16: use DcGeneral\DcGeneral;
17: use DcGeneral\EnvironmentInterface;
18: use DcGeneral\Event\EventPropagatorInterface;
19:
20: /**
21: * This interface describes a DcGeneral factory.
22: *
23: * The factory is responsible for creating a DcGeneral instance including the data definition container and environment.
24: *
25: * @package DcGeneral\Factory
26: */
27: interface DcGeneralFactoryInterface
28: {
29: /**
30: * Set the class name to use as environment.
31: *
32: * @param string $environmentClassName The class name.
33: *
34: * @return DcGeneralFactoryInterface
35: */
36: public function setEnvironmentClassName($environmentClassName);
37:
38: /**
39: * Retrieve the class name to use as environment.
40: *
41: * @return string
42: */
43: public function getEnvironmentClassName();
44:
45: /**
46: * Set the name for the data definition container.
47: *
48: * @param string $containerName The class name.
49: *
50: * @return DcGeneralFactoryInterface
51: */
52: public function setContainerName($containerName);
53:
54: /**
55: * Retrieve the name for the data definition container.
56: *
57: * @return string
58: */
59: public function getContainerName();
60:
61: /**
62: * Set the class name to use as data definition container.
63: *
64: * @param string $containerClassName The class name.
65: *
66: * @return DcGeneralFactoryInterface
67: */
68: public function setContainerClassName($containerClassName);
69:
70: /**
71: * Retrieve the class name to use as data definition container.
72: *
73: * @return string
74: */
75: public function getContainerClassName();
76:
77: /**
78: * Set the class name to use as DcGeneral.
79: *
80: * @param string $dcGeneralClassName The class name.
81: *
82: * @return DcGeneralFactoryInterface
83: */
84: public function setDcGeneralClassName($dcGeneralClassName);
85:
86: /**
87: * Retrieve the class name to use as DcGeneral.
88: *
89: * @return string
90: */
91: public function getDcGeneralClassName();
92:
93: /**
94: * Set the event propagator to use.
95: *
96: * @param EventPropagatorInterface $eventPropagator The event propagator.
97: *
98: * @return DcGeneralFactoryInterface
99: */
100: public function setEventPropagator(EventPropagatorInterface $eventPropagator);
101:
102: /**
103: * Retrieve the event propagator.
104: *
105: * @return EventPropagatorInterface
106: */
107: public function getEventPropagator();
108:
109: /**
110: * Set the translator to use.
111: *
112: * @param TranslatorInterface $translator The translator instance.
113: *
114: * @return DcGeneralFactoryInterface
115: */
116: public function setTranslator(TranslatorInterface $translator);
117:
118: /**
119: * Get the translator to use.
120: *
121: * @return TranslatorInterface
122: */
123: public function getTranslator();
124:
125: /**
126: * Set the environment to use.
127: *
128: * @param EnvironmentInterface $environment The environment instance.
129: *
130: * @return DcGeneralFactoryInterface
131: */
132: public function setEnvironment(EnvironmentInterface $environment = null);
133:
134: /**
135: * Retrieve the environment to use.
136: *
137: * @return EnvironmentInterface
138: */
139: public function getEnvironment();
140:
141: /**
142: * Set the data definition container to use.
143: *
144: * @param ContainerInterface $dataContainer The data definition container instance.
145: *
146: * @return DcGeneralFactoryInterface
147: */
148: public function setDataContainer(ContainerInterface $dataContainer = null);
149:
150: /**
151: * Retrieve the data definition container.
152: *
153: * @return ContainerInterface
154: */
155: public function getDataContainer();
156:
157: /**
158: * Create a new instance of DcGeneral.
159: *
160: * If no environment is given, a new one is created.
161: *
162: * @return DcGeneral
163: */
164: public function createDcGeneral();
165:
166: /**
167: * Create a new instance of Environment.
168: *
169: * If no container is given, a new one is created.
170: *
171: * @return EnvironmentInterface
172: */
173: public function createEnvironment();
174:
175: /**
176: * Create a new instance of Container.
177: *
178: * @return ContainerInterface
179: */
180: public function createContainer();
181: }
182: