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