1: <?php
2: /**
3: * Used by the QCubed Code Generator to describe a table Index
4: * @package Codegen
5: *
6: * @property string $KeyName
7: * @property boolean $Unique
8: * @property boolean $PrimaryKey
9: * @property string[] $ColumnNameArray
10: */
11: class QIndex extends QBaseClass {
12:
13: /////////////////////////////
14: // Protected Member Variables
15: /////////////////////////////
16:
17: /**
18: * Name of the index object, as defined in the database or create script
19: * @var string KeyName
20: */
21: protected $strKeyName;
22:
23: /**
24: * Specifies whether or not the index is unique
25: * @var bool Unique
26: */
27: protected $blnUnique;
28:
29: /**
30: * Specifies whether or not the column is the Primary Key index
31: * @var bool PrimaryKey
32: */
33: protected $blnPrimaryKey;
34:
35: /**
36: * Array of strings containing the names of the columns that
37: * this index indexes (indexed numerically)
38: * @var string[] ColumnNameArray
39: */
40: protected $strColumnNameArray;
41:
42:
43:
44:
45: ////////////////////
46: // Public Overriders
47: ////////////////////
48:
49: /**
50: * Override method to perform a property "Get"
51: * This will get the value of $strName
52: *
53: * @param string $strName Name of the property to get
54: * @throws Exception
55: * @throws QCallerException
56: * @return mixed
57: */
58: public function __get($strName) {
59: switch ($strName) {
60: case 'KeyName':
61: return $this->strKeyName;
62: case 'Unique':
63: return $this->blnUnique;
64: case 'PrimaryKey':
65: return $this->blnPrimaryKey;
66: case 'ColumnNameArray':
67: return $this->strColumnNameArray;
68: default:
69: try {
70: return parent::__get($strName);
71: } catch (QCallerException $objExc) {
72: $objExc->IncrementOffset();
73: throw $objExc;
74: }
75: }
76: }
77:
78: /**
79: * Override method to perform a property "Set"
80: * This will set the property $strName to be $mixValue
81: *
82: * @param string $strName Name of the property to set
83: * @param string $mixValue New value of the property
84: * @throws Exception
85: * @throws QCallerException
86: * @return mixed
87: */
88: public function __set($strName, $mixValue) {
89: try {
90: switch ($strName) {
91: case 'KeyName':
92: return $this->strKeyName = QType::Cast($mixValue, QType::String);
93: case 'Unique':
94: return $this->blnUnique = QType::Cast($mixValue, QType::Boolean);
95: case 'PrimaryKey':
96: return $this->blnPrimaryKey = QType::Cast($mixValue, QType::Boolean);
97: case 'ColumnNameArray':
98: return $this->strColumnNameArray = QType::Cast($mixValue, QType::ArrayType);
99: default:
100: return parent::__set($strName, $mixValue);
101: }
102: } catch (QCallerException $objExc) {
103: $objExc->IncrementOffset();
104: throw $objExc;
105: }
106: }
107: }