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