/** * Create and setup QListBox lstClassGrade * @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 lstClassGrade_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstClassGrade = new QListBox($this->objParentObject, $strControlId); $this->lstClassGrade->Name = QApplication::Translate('Class Grade'); $this->lstClassGrade->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objClassGradeCursor = ClassGrade::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objClassGrade = ClassGrade::InstantiateCursor($objClassGradeCursor)) { $objListItem = new QListItem($objClassGrade->__toString(), $objClassGrade->Id); if ($this->objClassRegistration->ClassGrade && $this->objClassRegistration->ClassGrade->Id == $objClassGrade->Id) { $objListItem->Selected = true; } $this->lstClassGrade->AddItem($objListItem); } // Return the QListBox return $this->lstClassGrade; }