1: <?php
2:
3: class QDatepickerBoxBase_CodeGenerator extends QTextBox_CodeGenerator {
4: public function __construct($strControlClassName = 'QDatepickerBox') {
5: parent::__construct($strControlClassName);
6: }
7:
8:
9: 10: 11: 12:
13: public function VarName($strPropName) {
14: return 'cal' . $strPropName;
15: }
16:
17: 18: 19: 20: 21: 22: 23: 24: 25:
26: public function ConnectorRefresh(QCodeGenBase $objCodeGen, QSqlTable $objTable, $objColumn, $blnInit = false) {
27: $strObjectName = $objCodeGen->ModelVariableName($objTable->Name);
28: $strPropName = $objColumn->Reference ? $objColumn->Reference->PropertyName : $objColumn->PropertyName;
29: $strControlVarName = $this->VarName($strPropName);
30:
31: if ($blnInit) {
32: $strRet = "\t\t\t\$this->{$strControlVarName}->DateTime = \$this->{$strObjectName}->{$strPropName};";
33: } else {
34: $strRet = "\t\t\tif (\$this->{$strControlVarName}) \$this->{$strControlVarName}->DateTime = \$this->{$strObjectName}->{$strPropName};";
35: }
36: return $strRet . "\n";
37: }
38:
39: 40: 41: 42: 43: 44:
45: public function ConnectorUpdate(QCodeGenBase $objCodeGen, QSqlTable $objTable, $objColumn) {
46: $strObjectName = $objCodeGen->ModelVariableName($objTable->Name);
47: $strPropName = $objColumn->Reference ? $objColumn->Reference->PropertyName : $objColumn->PropertyName;
48: $strControlVarName = $this->VarName($strPropName);
49: $strRet = <<<TMPL
50: if (\$this->{$strControlVarName}) \$this->{$strObjectName}->{$objColumn->PropertyName} = \$this->{$strControlVarName}->DateTime;
51:
52: TMPL;
53: return $strRet;
54: }
55: }