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