__set() public method

public __set ( $strName, $mixValue )
Example #1
0
 public function __set($strName, $mixValue)
 {
     $this->blnModified = true;
     switch ($strName) {
         // APPEARANCE
         case "TextAlign":
             try {
                 $this->strTextAlign = QType::Cast($mixValue, QType::String);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "HtmlEntities":
             try {
                 $this->blnHtmlEntities = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             // LAYOUT
         // LAYOUT
         case "CellPadding":
             try {
                 $this->intCellPadding = QType::Cast($mixValue, QType::Integer);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "CellSpacing":
             try {
                 $this->intCellSpacing = QType::Cast($mixValue, QType::Integer);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "RepeatColumns":
             try {
                 $this->intRepeatColumns = QType::Cast($mixValue, QType::Integer);
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             if ($this->intRepeatColumns < 1) {
                 throw new QCallerException("RepeatColumns must be greater than 0");
             }
             break;
         case "RepeatDirection":
             try {
                 $this->strRepeatDirection = QType::Cast($mixValue, QType::String);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         default:
             try {
                 parent::__set($strName, $mixValue);
                 break;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
 /**
  * PHP magic method
  * @param string $strName
  * @param string $mixValue
  *
  * @return mixed
  * @throws Exception|QCallerException|QInvalidCastException
  */
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         // APPEARANCE
         case "Rows":
             try {
                 $this->SetHtmlAttribute('size', QType::Cast($mixValue, QType::Integer));
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "LabelForRequired":
             try {
                 $this->strLabelForRequired = QType::Cast($mixValue, QType::String);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "LabelForRequiredUnnamed":
             try {
                 $this->strLabelForRequiredUnnamed = QType::Cast($mixValue, QType::String);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             // BEHAVIOR
         // BEHAVIOR
         case "SelectionMode":
             try {
                 if (QType::Cast($mixValue, QType::String) == QSelectionMode::Multiple) {
                     $this->SetHtmlAttribute('multiple', 'multiple');
                 } else {
                     $this->RemoveHtmlAttribute('multiple');
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         default:
             try {
                 parent::__set($strName, $mixValue);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
     }
 }
 public function __set($strName, $mixValue)
 {
     $this->blnModified = true;
     switch ($strName) {
         // APPEARANCE
         case "Rows":
             try {
                 $this->intRows = QType::Cast($mixValue, QType::Integer);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "LabelForRequired":
             try {
                 $this->strLabelForRequired = QType::Cast($mixValue, QType::String);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "LabelForRequiredUnnamed":
             try {
                 $this->strLabelForRequiredUnnamed = QType::Cast($mixValue, QType::String);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "HtmlEntities":
             try {
                 $this->blnHtmlEntities = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             // BEHAVIOR
         // BEHAVIOR
         case "SelectionMode":
             try {
                 $this->strSelectionMode = QType::Cast($mixValue, QType::String);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "ItemStyle":
             try {
                 $this->objItemStyle = QType::Cast($mixValue, "QListItemStyle");
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
         default:
             try {
                 parent::__set($strName, $mixValue);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
     }
 }
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         // APPEARANCE
         case "TextAlign":
             try {
                 if ($this->strTextAlign !== ($mixValue = QType::Cast($mixValue, QType::String))) {
                     $this->blnModified = true;
                     $this->strTextAlign = $mixValue;
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "HtmlEntities":
             try {
                 if ($this->blnHtmlEntities !== ($mixValue = QType::Cast($mixValue, QType::Boolean))) {
                     $this->blnModified = true;
                     $this->blnHtmlEntities = $mixValue;
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             // LAYOUT
         // LAYOUT
         case "CellPadding":
             try {
                 if ($this->intCellPadding !== ($mixValue = QType::Cast($mixValue, QType::Integer))) {
                     $this->blnModified = true;
                     $this->intCellPadding = $mixValue;
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "CellSpacing":
             try {
                 if ($this->intCellSpacing !== ($mixValue = QType::Cast($mixValue, QType::Integer))) {
                     $this->blnModified = true;
                     $this->intCellSpacing = $mixValue;
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "RepeatColumns":
             try {
                 if ($this->intRepeatColumns !== ($mixValue = QType::Cast($mixValue, QType::Integer))) {
                     $this->blnModified = true;
                     $this->intRepeatColumns = $mixValue;
                 }
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             if ($this->intRepeatColumns < 1) {
                 throw new QCallerException("RepeatColumns must be greater than 0");
             }
             break;
         case "RepeatDirection":
             try {
                 if ($this->strRepeatDirection !== ($mixValue = QType::Cast($mixValue, QType::String))) {
                     $this->blnModified = true;
                     $this->strRepeatDirection = $mixValue;
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "ItemStyle":
             try {
                 $this->blnModified = true;
                 $this->objItemStyle = QType::Cast($mixValue, "QTagStyler");
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
         case "ButtonMode":
             try {
                 if ($this->intButtonMode !== ($mixValue = QType::Cast($mixValue, QType::Integer))) {
                     $this->blnModified = true;
                     $this->intButtonMode = $mixValue;
                 }
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
         case "MaxHeight":
             try {
                 if (empty($mixValue)) {
                     $this->strMaxHeight = null;
                 } else {
                     $this->strMaxHeight = QType::Cast($mixValue, QType::String);
                 }
                 $this->blnModified = true;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
         default:
             try {
                 parent::__set($strName, $mixValue);
                 break;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }