__set() публичный Метод

public __set ( $strName, $mixValue )
Пример #1
0
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         case 'Disabled':
             try {
                 $this->blnDisabled = QType::Cast($mixValue, QType::Boolean);
                 if ($this->OnPage) {
                     $this->CallJqUiMethod(true, 'option', 'disabled', $this->blnDisabled);
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Icons':
             $this->mixIcons = $mixValue;
             if ($this->OnPage) {
                 $this->CallJqUiMethod(true, 'option', 'icons', $mixValue);
             }
             break;
         case 'Label':
             try {
                 $this->strLabel = QType::Cast($mixValue, QType::String);
                 if ($this->OnPage) {
                     $this->CallJqUiMethod(true, 'option', 'label', $this->strLabel);
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'JqText':
             try {
                 $this->blnJqText = QType::Cast($mixValue, QType::Boolean);
                 if ($this->OnPage) {
                     $this->CallJqUiMethod(true, 'option', 'text', $this->blnJqText);
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case 'Enabled':
             $this->Disabled = !$mixValue;
             // Tie in standard QCubed functionality
             parent::__set($strName, $mixValue);
             break;
         default:
             try {
                 parent::__set($strName, $mixValue);
                 break;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }
 /**
  * PHP __set magic method implementation
  *
  * @param string $strName  Name of the property
  * @param string $mixValue Value of the property
  *
  * @return mixed
  * @throws Exception|QCallerException|QInvalidCastException
  */
 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         case "GroupName":
             try {
                 $strGroupName = QType::Cast($mixValue, QType::String);
                 if ($this->strGroupName != $strGroupName) {
                     $this->strGroupName = $strGroupName;
                     $this->blnModified = true;
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "Checked":
             try {
                 $val = QType::Cast($mixValue, QType::Boolean);
                 if ($val != $this->blnChecked) {
                     $this->blnChecked = $val;
                     if ($this->GroupName && $val == true) {
                         QApplication::ExecuteJsFunction('qcubed.setRadioInGroup', $this->strControlId);
                     } else {
                         $this->AddAttributeScript('prop', 'checked', $val);
                         // just set the one radio
                     }
                 }
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         default:
             try {
                 parent::__set($strName, $mixValue);
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
             break;
     }
 }