A QCodo powered CMS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.9 KiB

  1. /**
  2. * Override method to perform a property "Set"
  3. * This will set the property $strName to be $mixValue
  4. *
  5. * @param string $strName Name of the property to set
  6. * @param string $mixValue New value of the property
  7. * @return mixed
  8. */
  9. public function __set($strName, $mixValue) {
  10. try {
  11. switch ($strName) {
  12. // Controls that point to <%= $objTable->ClassName %> fields
  13. <% foreach ($objTable->ColumnArray as $objColumn) { %><%
  14. $strControlId = $objCodeGen->FormControlVariableNameForColumn($objColumn);
  15. $strPropertyName = $objColumn->PropertyName . 'Control';
  16. $strClassName = $objCodeGen->FormControlTypeForColumn($objColumn);
  17. %><%@ property_set_case('strControlId', 'strPropertyName', 'strClassName'); %>
  18. <% } %>
  19. <% foreach ($objTable->ReverseReferenceArray as $objReverseReference) { %><% if ($objReverseReference->Unique) { %><%
  20. $strControlId = $objCodeGen->FormControlVariableNameForUniqueReverseReference($objReverseReference);
  21. $strPropertyName = $objReverseReference->ObjectDescription . 'Control';
  22. $strClassName = 'QListBox';
  23. %><%@ property_set_case('strControlId', 'strPropertyName', 'strClassName'); %>
  24. <% } %><% } %>
  25. <% foreach ($objTable->ManyToManyReferenceArray as $objManyToManyReference) { %><%
  26. $strControlId = $objCodeGen->FormControlVariableNameForManyToManyReference($objManyToManyReference);
  27. $strPropertyName = $objManyToManyReference->ObjectDescription . 'Control';
  28. $strClassName = 'QListBox';
  29. %><%@ property_set_case('strControlId', 'strPropertyName', 'strClassName'); %>
  30. <% } %>
  31. default:
  32. return parent::__set($strName, $mixValue);
  33. }
  34. } catch (QCallerException $objExc) {
  35. $objExc->IncrementOffset();
  36. throw $objExc;
  37. }
  38. }