1: <?php
2: /**
3: * Used by the QCubed Code Generator to describe a column reference from
4: * the table's perspective (aka a Foreign Key from the referenced Table's point of view)
5: * @package Codegen
6: *
7: * @property string $KeyName
8: * @property string $Table
9: * @property string $Column
10: * @property string $PropertyName
11: * @property string $OppositeColumn
12: * @property string $OppositeVariableType
13: * @property string $OppositeDbType
14: * @property string $OppositeVariableName
15: * @property string $OppositePropertyName
16: * @property string $OppositeObjectDescription
17: * @property string $AssociatedTable
18: * @property string $VariableName
19: * @property string $VariableType
20: * @property string $ObjectDescription
21: * @property string $ObjectDescriptionPlural
22: * @property QSqlColumn[] $ColumnArray
23: * @property boolean $IsTypeAssociation
24: * @property array $Options
25: */
26: class QManyToManyReference extends QBaseClass {
27:
28: /////////////////////////////
29: // Protected Member Variables
30: /////////////////////////////
31:
32: /**
33: * Name of the foreign key object itself, as defined in the database or create script
34: * @var string KeyName
35: */
36: protected $strKeyName;
37:
38: /**
39: * Name of the association table, itself (the many-to-many table that maps
40: * the relationshipfor this ManyToManyReference)
41: * @var string Table
42: */
43: protected $strTable;
44:
45: /**
46: * Name of the referencing column (the column that owns the foreign key to this table)
47: * @var string Column
48: */
49: protected $strColumn;
50:
51: /**
52: * Name of property corresponding to this column as used in the node.
53: * @var string PropertyName
54: */
55: protected $strPropertyName;
56:
57: /**
58: * Name of the opposite column (the column that owns the foreign key to the related table)
59: * @var string OppositeColumn
60: */
61: protected $strOppositeColumn;
62:
63: /**
64: * Type of the opposite column (the column that owns the foreign key to the related table)
65: * as a Variable type (for example, to be used to define the input parameter type to a Load function)
66: * @var string OppositeVariableType
67: */
68: protected $strOppositeVariableType;
69:
70: /**
71: * Database type of the opposite column (the column that owns the foreign key to the related table)
72: * as a DbType (for example, to be used to define the input parameter type to a Node)
73: * @var string OppositeDbType
74: */
75: protected $strOppositeDbType;
76:
77:
78: /**
79: * Name of the opposite column (the column that owns the foreign key to the related table)
80: * as a Variable name (for example, to be used as an input parameter to a Load function)
81: * @var string OppositeVariableName
82: */
83: protected $strOppositeVariableName;
84:
85: /**
86: * Name of the opposite column (the column that owns the foreign key to the related table)
87: * as a Property name (for example, to be used as a QQAssociationNode parameter name for the
88: * column itself)
89: * @var string OppositePropertyName
90: */
91: protected $strOppositePropertyName;
92:
93: /**
94: * Name of the opposite column (the column that owns the foreign key to the related table)
95: * as an Object Description (see "ObjectDescription" below)
96: * @var string OppositeObjectDescription
97: */
98: protected $strOppositeObjectDescription;
99:
100: /**
101: * The name of the associated table (the table that the OTHER
102: * column in the association table points to)
103: * @var string AssociatedTable
104: */
105: protected $strAssociatedTable;
106:
107: /**
108: * Name of the reverse-referenced object as an function parameter.
109: * So if this is a reverse reference to "person" via "report.person_id",
110: * the VariableName would be "objReport"
111: * @var string VariableName
112: */
113: protected $strVariableName;
114:
115: /**
116: * Type of the reverse-referenced object as a class.
117: * So if this is a reverse reference to "person" via "report.person_id",
118: * the VariableName would be "Report"
119: * @var string VariableType
120: */
121: protected $strVariableType;
122:
123: /**
124: * Singular object description used in the function names for the
125: * reverse reference. See documentation for more details.
126: * @var string ObjectDescription
127: */
128: protected $strObjectDescription;
129:
130: /**
131: * Plural object description used in the function names for the
132: * reverse reference. See documentation for more details.
133: * @var string VariableType
134: */
135: protected $strObjectDescriptionPlural;
136:
137: /**
138: * Array of non-FK Column objects (as indexed by Column name)
139: * @var QSqlColumn[] ColumnArray
140: */
141: protected $objColumnArray;
142: /**
143: * Array of non-FK Column objects (as indexed by Column name)
144: * @var boolean IsTypeAssociation
145: */
146: protected $blnIsTypeAssociation;
147:
148: /**
149: * Keyed array of overrides read from the override file
150: * @var array Overrides
151: */
152: protected $options;
153:
154:
155:
156:
157:
158: ////////////////////
159: // Public Overriders
160: ////////////////////
161:
162: /**
163: * Override method to perform a property "Get"
164: * This will get the value of $strName
165: *
166: * @param string $strName Name of the property to get
167: * @throws Exception
168: * @throws QCallerException
169: * @return mixed
170: */
171: public function __get($strName) {
172: switch ($strName) {
173: case 'KeyName':
174: return $this->strKeyName;
175: case 'Table':
176: return $this->strTable;
177: case 'Column':
178: return $this->strColumn;
179: case 'PropertyName':
180: return $this->strPropertyName;
181: case 'OppositeColumn':
182: return $this->strOppositeColumn;
183: case 'OppositeVariableType':
184: return $this->strOppositeVariableType;
185: case 'OppositeDbType':
186: return $this->strOppositeDbType;
187: case 'OppositeVariableName':
188: return $this->strOppositeVariableName;
189: case 'OppositePropertyName':
190: return $this->strOppositePropertyName;
191: case 'OppositeObjectDescription':
192: return $this->strOppositeObjectDescription;
193: case 'AssociatedTable':
194: return $this->strAssociatedTable;
195: case 'VariableName':
196: return $this->strVariableName;
197: case 'VariableType':
198: return $this->strVariableType;
199: case 'ObjectDescription':
200: return $this->strObjectDescription;
201: case 'ObjectDescriptionPlural':
202: return $this->strObjectDescriptionPlural;
203: case 'ColumnArray':
204: return $this->objColumnArray;
205: case 'IsTypeAssociation':
206: return $this->blnIsTypeAssociation;
207: case 'Options':
208: return $this->options;
209:
210: default:
211: try {
212: return parent::__get($strName);
213: } catch (QCallerException $objExc) {
214: $objExc->IncrementOffset();
215: throw $objExc;
216: }
217: }
218: }
219:
220: /**
221: * Override method to perform a property "Set"
222: * This will set the property $strName to be $mixValue
223: *
224: * @param string $strName Name of the property to set
225: * @param string $mixValue New value of the property
226: * @throws Exception
227: * @throws QCallerException
228: * @return mixed
229: */
230: public function __set($strName, $mixValue) {
231: try {
232: switch ($strName) {
233: case 'KeyName':
234: return $this->strKeyName = QType::Cast($mixValue, QType::String);
235: case 'Table':
236: return $this->strTable = QType::Cast($mixValue, QType::String);
237: case 'Column':
238: return $this->strColumn = QType::Cast($mixValue, QType::String);
239: case 'PropertyName':
240: return $this->strPropertyName = QType::Cast($mixValue, QType::String);
241: case 'OppositeColumn':
242: return $this->strOppositeColumn = QType::Cast($mixValue, QType::String);
243: case 'OppositeVariableType':
244: return $this->strOppositeVariableType = QType::Cast($mixValue, QType::String);
245: case 'OppositeDbType':
246: return $this->strOppositeDbType = QType::Cast($mixValue, QType::String);
247: case 'OppositeVariableName':
248: return $this->strOppositeVariableName = QType::Cast($mixValue, QType::String);
249: case 'OppositePropertyName':
250: return $this->strOppositePropertyName = QType::Cast($mixValue, QType::String);
251: case 'OppositeObjectDescription':
252: return $this->strOppositeObjectDescription = QType::Cast($mixValue, QType::String);
253: case 'AssociatedTable':
254: return $this->strAssociatedTable = QType::Cast($mixValue, QType::String);
255: case 'VariableName':
256: return $this->strVariableName = QType::Cast($mixValue, QType::String);
257: case 'VariableType':
258: return $this->strVariableType = QType::Cast($mixValue, QType::String);
259: case 'ObjectDescription':
260: return $this->strObjectDescription = QType::Cast($mixValue, QType::String);
261: case 'ObjectDescriptionPlural':
262: return $this->strObjectDescriptionPlural = QType::Cast($mixValue, QType::String);
263: case 'ColumnArray':
264: return $this->objColumnArray = QType::Cast($mixValue, QType::ArrayType);
265: case 'IsTypeAssociation':
266: return $this->blnIsTypeAssociation = QType::Cast($mixValue, QType::Boolean);
267: case 'Options':
268: return $this->options = QType::Cast($mixValue, QType::ArrayType);
269: default:
270: return parent::__set($strName, $mixValue);
271: }
272: } catch (QCallerException $objExc) {
273: $objExc->IncrementOffset();
274: throw $objExc;
275: }
276: }
277: }