/** * Create and setup QListBox lstDefaultCustomFieldValue * @param string $strControlId optional ControlId to use * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return QListBox */ public function lstDefaultCustomFieldValue_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstDefaultCustomFieldValue = new QListBox($this->objParentObject, $strControlId); $this->lstDefaultCustomFieldValue->Name = QApplication::Translate('Default Custom Field Value'); $this->lstDefaultCustomFieldValue->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objDefaultCustomFieldValueCursor = CustomFieldValue::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objDefaultCustomFieldValue = CustomFieldValue::InstantiateCursor($objDefaultCustomFieldValueCursor)) { $objListItem = new QListItem($objDefaultCustomFieldValue->__toString(), $objDefaultCustomFieldValue->CustomFieldValueId); if ($this->objCustomField->DefaultCustomFieldValue && $this->objCustomField->DefaultCustomFieldValue->CustomFieldValueId == $objDefaultCustomFieldValue->CustomFieldValueId) { $objListItem->Selected = true; } $this->lstDefaultCustomFieldValue->AddItem($objListItem); } // Return the QListBox return $this->lstDefaultCustomFieldValue; }