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