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