/** * Create and setup QListBox lstParentPagerPeriod * @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 lstParentPagerPeriod_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstParentPagerPeriod = new QListBox($this->objParentObject, $strControlId); $this->lstParentPagerPeriod->Name = QApplication::Translate('Parent Pager Period'); $this->lstParentPagerPeriod->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objParentPagerPeriodCursor = ParentPagerPeriod::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objParentPagerPeriod = ParentPagerPeriod::InstantiateCursor($objParentPagerPeriodCursor)) { $objListItem = new QListItem($objParentPagerPeriod->__toString(), $objParentPagerPeriod->Id); if ($this->objParentPagerChildHistory->ParentPagerPeriod && $this->objParentPagerChildHistory->ParentPagerPeriod->Id == $objParentPagerPeriod->Id) { $objListItem->Selected = true; } $this->lstParentPagerPeriod->AddItem($objListItem); } // Return the QListBox return $this->lstParentPagerPeriod; }