Exemplo n.º 1
0
 /**
  * Create and setup QListBox lstMarriageAsLinked
  * @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 lstMarriageAsLinked_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null)
 {
     $this->lstMarriageAsLinked = new QListBox($this->objParentObject, $strControlId);
     $this->lstMarriageAsLinked->Name = QApplication::Translate('Marriage As Linked');
     $this->lstMarriageAsLinked->AddItem(QApplication::Translate('- Select One -'), null);
     // Setup and perform the Query
     if (is_null($objCondition)) {
         $objCondition = QQ::All();
     }
     $objMarriageCursor = Marriage::QueryCursor($objCondition, $objOptionalClauses);
     // Iterate through the Cursor
     while ($objMarriage = Marriage::InstantiateCursor($objMarriageCursor)) {
         $objListItem = new QListItem($objMarriage->__toString(), $objMarriage->Id);
         if ($objMarriage->LinkedMarriageId == $this->objMarriage->Id) {
             $objListItem->Selected = true;
         }
         $this->lstMarriageAsLinked->AddItem($objListItem);
     }
     // Return the QListBox
     return $this->lstMarriageAsLinked;
 }