/** * Create and setup QListBox lstRoleModule * @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 lstRoleModule_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstRoleModule = new QListBox($this->objParentObject, $strControlId); $this->lstRoleModule->Name = QApplication::Translate('Role Module'); $this->lstRoleModule->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objRoleModuleCursor = RoleModule::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objRoleModule = RoleModule::InstantiateCursor($objRoleModuleCursor)) { $objListItem = new QListItem($objRoleModule->__toString(), $objRoleModule->RoleModuleId); if ($this->objRoleModuleAuthorization->RoleModule && $this->objRoleModuleAuthorization->RoleModule->RoleModuleId == $objRoleModule->RoleModuleId) { $objListItem->Selected = true; } $this->lstRoleModule->AddItem($objListItem); } // Return the QListBox return $this->lstRoleModule; }