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.

41 lines
2.2 KiB

  1. /**
  2. * Override method to perform a property "Get"
  3. * This will get the value of $strName
  4. *
  5. * @param string $strName Name of the property to get
  6. * @return mixed
  7. */
  8. public function __get($strName) {
  9. switch ($strName) {
  10. // General MetaControlVariables
  11. case '<%= $objTable->ClassName %>': return $this-><%= $objCodeGen->VariableNameFromTable($objTable->Name); %>;
  12. case 'TitleVerb': return $this->strTitleVerb;
  13. case 'EditMode': return $this->blnEditMode;
  14. // Controls that point to <%= $objTable->ClassName %> fields -- will be created dynamically if not yet created
  15. <% foreach ($objTable->ColumnArray as $objColumn) { %><%
  16. $strControlId = $objCodeGen->FormControlVariableNameForColumn($objColumn);
  17. $strLabelId = $objCodeGen->FormLabelVariableNameForColumn($objColumn);
  18. $strPropertyName = $objColumn->PropertyName;
  19. %><%@ property_get_case('strControlId', 'strLabelId', 'strPropertyName'); %>
  20. <% } %>
  21. <% foreach ($objTable->ReverseReferenceArray as $objReverseReference) { %><% if ($objReverseReference->Unique) { %><%
  22. $strControlId = $objCodeGen->FormControlVariableNameForUniqueReverseReference($objReverseReference);
  23. $strLabelId = $objCodeGen->FormLabelVariableNameForUniqueReverseReference($objReverseReference);
  24. $strPropertyName = $objReverseReference->ObjectDescription;
  25. %><%@ property_get_case('strControlId', 'strLabelId', 'strPropertyName'); %>
  26. <% } %><% } %>
  27. <% foreach ($objTable->ManyToManyReferenceArray as $objManyToManyReference) { %><%
  28. $strControlId = $objCodeGen->FormControlVariableNameForManyToManyReference($objManyToManyReference);
  29. $strLabelId = $objCodeGen->FormLabelVariableNameForManyToManyReference($objManyToManyReference);
  30. $strPropertyName = $objManyToManyReference->ObjectDescription;
  31. %><%@ property_get_case('strControlId', 'strLabelId', 'strPropertyName'); %>
  32. <% } %>
  33. default:
  34. try {
  35. return parent::__get($strName);
  36. } catch (QCallerException $objExc) {
  37. $objExc->IncrementOffset();
  38. throw $objExc;
  39. }
  40. }
  41. }