/** * Create and setup QListBox lstAuthorizationLevel * @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 lstAuthorizationLevel_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstAuthorizationLevel = new QListBox($this->objParentObject, $strControlId); $this->lstAuthorizationLevel->Name = QApplication::Translate('Authorization Level'); $this->lstAuthorizationLevel->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objAuthorizationLevelCursor = AuthorizationLevel::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objAuthorizationLevel = AuthorizationLevel::InstantiateCursor($objAuthorizationLevelCursor)) { $objListItem = new QListItem($objAuthorizationLevel->__toString(), $objAuthorizationLevel->AuthorizationLevelId); if ($this->objRoleModuleAuthorization->AuthorizationLevel && $this->objRoleModuleAuthorization->AuthorizationLevel->AuthorizationLevelId == $objAuthorizationLevel->AuthorizationLevelId) { $objListItem->Selected = true; } $this->lstAuthorizationLevel->AddItem($objListItem); } // Return the QListBox return $this->lstAuthorizationLevel; }