/** * Create and setup QListBox lstLanguage * @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 lstLanguage_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstLanguage = new QListBox($this->objParentObject, $strControlId); $this->lstLanguage->Name = QApplication::Translate('Language'); $this->lstLanguage->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objLanguageCursor = NarroLanguage::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objLanguage = NarroLanguage::InstantiateCursor($objLanguageCursor)) { $objListItem = new QListItem($objLanguage->__toString(), $objLanguage->LanguageId); if ($this->objNarroLog->Language && $this->objNarroLog->Language->LanguageId == $objLanguage->LanguageId) { $objListItem->Selected = true; } $this->lstLanguage->AddItem($objListItem); } // Return the QListBox return $this->lstLanguage; }