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