/** * Create and setup QListBox lstClassTerm * @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 lstClassTerm_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstClassTerm = new QListBox($this->objParentObject, $strControlId); $this->lstClassTerm->Name = QApplication::Translate('Class Term'); $this->lstClassTerm->Required = true; if (!$this->blnEditMode) { $this->lstClassTerm->AddItem(QApplication::Translate('- Select One -'), null); } // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objClassTermCursor = ClassTerm::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objClassTerm = ClassTerm::InstantiateCursor($objClassTermCursor)) { $objListItem = new QListItem($objClassTerm->__toString(), $objClassTerm->Id); if ($this->objClassMeeting->ClassTerm && $this->objClassMeeting->ClassTerm->Id == $objClassTerm->Id) { $objListItem->Selected = true; } $this->lstClassTerm->AddItem($objListItem); } // Return the QListBox return $this->lstClassTerm; }