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