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\Contao\Dca;
14:
15: use DcGeneral\DataDefinition\DataProviderInformation;
16:
17: /**
18: * Class ContaoDataProviderInformation.
19: *
20: * This Information holds the details of a Contao data provider definition.
21: *
22: * @package DcGeneral\Contao\Dca
23: */
24: class ContaoDataProviderInformation extends DataProviderInformation
25: {
26: /**
27: * The table name to use.
28: *
29: * @var string
30: */
31: protected $tableName;
32:
33: /**
34: * Name of the provider class to use.
35: *
36: * @var string
37: */
38: protected $className = 'DcGeneral\Data\DefaultDataProvider';
39:
40: /**
41: * Custom initialization data to be passed to the constructor of the data provider class.
42: *
43: * @var mixed
44: */
45: protected $initializationData;
46:
47: /**
48: * Set the table name of the data provider.
49: *
50: * @param string $tableName The name of the table in the database.
51: *
52: * @return ContaoDataProviderInformation
53: */
54: public function setTableName($tableName)
55: {
56: $this->tableName = $tableName;
57:
58: return $this;
59: }
60:
61: /**
62: * Retrieve the table name of the data provider.
63: *
64: * @return string
65: */
66: public function getTableName()
67: {
68: return $this->tableName;
69: }
70:
71: /**
72: * Set the data provider class to use, defaults to 'DcGeneral\Data\DefaultDataProvider'.
73: *
74: * @param string $className The name of the data provider class to use.
75: *
76: * @return ContaoDataProviderInformation
77: */
78: public function setClassName($className)
79: {
80: $this->className = $className;
81:
82: return $this;
83: }
84:
85: /**
86: * Retrieve the data provider class to use.
87: *
88: * @return string
89: */
90: public function getClassName()
91: {
92: return $this->className;
93: }
94:
95: /**
96: * Set the data to use for initialization of the data provider.
97: *
98: * The nature of this data is subject to the concrete implementation of the data provider defined as the class to use.
99: *
100: * @param mixed $initializationData The initialization data the data provider class expects.
101: *
102: * @return ContaoDataProviderInformation
103: */
104: public function setInitializationData($initializationData)
105: {
106: $this->initializationData = $initializationData;
107:
108: return $this;
109: }
110:
111: /**
112: * Retrieve the data to use for initialization of the data provider.
113: *
114: * @return mixed
115: */
116: public function getInitializationData()
117: {
118: return $this->initializationData;
119: }
120: }
121: