/**
  * Similar to MetaAddColumn, except it creates a column for a Type-based Id.  You MUST specify
  * the name of the Type class that this will attempt to use $NameArray against.
  * 
  * Also, $mixContent cannot be an array.  Only a single field can be specified.
  *
  * @param mixed $mixContent string or QQNode from Country
  * @param string $strTypeClassName the name of the TypeClass to use $NameArray against
  * @param mixed $objOverrideParameters
  */
 public function MetaAddTypeColumn($mixContent, $strTypeClassName, $objOverrideParameters = null)
 {
     // Validate TypeClassName
     if (!class_exists($strTypeClassName) || !property_exists($strTypeClassName, 'NameArray')) {
         throw new QCallerException('Invalid TypeClass Name: ' . $strTypeClassName);
     }
     // Validate Node
     try {
         $objNode = $this->ResolveContentItem($mixContent);
     } catch (QCallerException $objExc) {
         $objExc->IncrementOffset();
         throw $objExc;
     }
     // Create the Column
     $strName = QConvertNotation::WordsFromCamelCase($objNode->_PropertyName);
     if (strtolower(substr($strName, strlen($strName) - 3)) == ' id') {
         $strName = substr($strName, 0, strlen($strName) - 3);
     }
     $strProperty = $objNode->GetDataGridHtml();
     $objNewColumn = new QDataGridColumn(QApplication::Translate($strName), sprintf('<?=(%s) ? %s::$NameArray[%s] : null;?>', $strProperty, $strTypeClassName, $strProperty), array('OrderByClause' => QQ::OrderBy($objNode), 'ReverseOrderByClause' => QQ::OrderBy($objNode, false)));
     // Perform Overrides
     $objOverrideArray = func_get_args();
     if (count($objOverrideArray) > 2) {
         try {
             unset($objOverrideArray[0]);
             unset($objOverrideArray[1]);
             $objNewColumn->OverrideAttributes($objOverrideArray);
         } catch (QCallerException $objExc) {
             $objExc->IncrementOffset();
             throw $objExc;
         }
     }
     $this->AddColumn($objNewColumn);
     return $objNewColumn;
 }
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function <?php 
echo $strLabelId;
?>
_Create($strControlId = null) {
			$this-><?php 
echo $strLabelId;
?>
 = new QLabel($this->objParentObject, $strControlId);
			$this-><?php 
echo $strLabelId;
?>
->Name = QApplication::Translate('<?php 
echo QConvertNotation::WordsFromCamelCase($objReverseReference->ObjectPropertyName);
?>
');
			$this-><?php 
echo $strLabelId;
?>
->Text = ($this-><?php 
echo $strObjectName;
?>
-><?php 
echo $objReverseReference->ObjectPropertyName;
?>
) ? $this-><?php 
echo $strObjectName;
?>
-><?php 
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function <?php 
echo $strLabelId;
?>
_Create($strControlId = null) {
			$this-><?php 
echo $strLabelId;
?>
 = new QLabel($this->objParentObject, $strControlId);
			$this-><?php 
echo $strLabelId;
?>
->Name = QApplication::Translate('<?php 
echo QConvertNotation::WordsFromCamelCase($objManyToManyReference->ObjectDescriptionPlural);
?>
');
			
			$aSelection = $this-><?php 
echo $strObjectName;
?>
->Get<?php 
echo $objManyToManyReference->ObjectDescription;
?>
Array();
			$this-><?php 
echo $strLabelId;
?>
->Text = implode($this->str<?php 
echo $objManyToManyReference->ObjectDescription;
 /**
  * Returns the name of an item in the data list as will be displayed in the edit panel.
  *
  * @param QSqlTable $objTable
  *
  * @return string
  */
 public static function DataListItemName(QSqlTable $objTable)
 {
     if (($o = $objTable->Options) && isset($o['ItemName'])) {
         // Did developer override?
         return $o['ItemName'];
     }
     return QConvertNotation::WordsFromCamelCase($objTable->ClassName);
 }
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function <?php 
echo $strLabelId;
?>
_Create($strControlId = null) {
			$this-><?php 
echo $strLabelId;
?>
 = new QLabel($this->objParentObject, $strControlId);
			$this-><?php 
echo $strLabelId;
?>
->Name = QApplication::Translate('<?php 
echo QConvertNotation::WordsFromCamelCase($objColumn->Reference->PropertyName);
?>
');
			$this-><?php 
echo $strLabelId;
?>
->Text = ($this-><?php 
echo $strObjectName;
?>
-><?php 
echo $objColumn->Reference->PropertyName;
?>
) ? $this-><?php 
echo $strObjectName;
?>
-><?php 
Пример #6
0
 /**
  * The function determines whether there is a comment on the column or not.
  * If yes, and the settings for the database has the option for using comments for Meta Control label names turned on
  * along with a preferred delimiter supplied, then the function will return the computed meta control label name. Otherwise it
  * just returns the PropertyName of the column.
  *
  * @param QColumn $objColumn
  *
  * @internal param string $strDelimiter
  * @return string
  */
 public static function MetaControlLabelNameFromColumn(QColumn $objColumn)
 {
     $strDelimiter = null;
     $objTable = $objColumn->OwnerTable;
     $objDbIndex = $objTable->OwnerDbIndex;
     foreach (QCodeGen::$CodeGenArray as $DatabaseCodeGen) {
         if ($DatabaseCodeGen instanceof QDatabaseCodeGen && $DatabaseCodeGen->DatabaseIndex == $objDbIndex) {
             $strDelimiter = $DatabaseCodeGen->CommentMetaControlLabelDelimiter;
             break;
         }
     }
     if (trim($strDelimiter) == '') {
         $strDelimiter = null;
     }
     if ($strDelimiter && $objColumn->Comment && ($strLabelText = strstr($objColumn->Comment, $strDelimiter, true))) {
         return str_replace("'", "\\'", $strLabelText);
     }
     return QConvertNotation::WordsFromCamelCase($objColumn->PropertyName);
 }