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