QDataGridBase::__set PHP Méthode

__set() public méthode

public __set ( $strName, $mixValue )
    public function __set($strName, $mixValue)
    {
        switch ($strName) {
            // APPEARANCE
            case "AlternateRowStyle":
                try {
                    $this->objAlternateRowStyle = QType::Cast($mixValue, "QDataGridRowStyle");
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
            case "BorderCollapse":
                try {
                    $this->strBorderCollapse = QType::Cast($mixValue, QType::String);
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
            case "HeaderRowStyle":
                try {
                    $this->objHeaderRowStyle = QType::Cast($mixValue, "QDataGridRowStyle");
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
            case "HeaderLinkStyle":
                try {
                    $this->objHeaderLinkStyle = QType::Cast($mixValue, "QDataGridRowStyle");
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
            case "RowStyle":
                try {
                    $this->objRowStyle = QType::Cast($mixValue, "QDataGridRowStyle");
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
                // BEHAVIOR
            // BEHAVIOR
            case "UseAjax":
                try {
                    $blnToReturn = parent::__set($strName, $mixValue);
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
                // Because we are switching to/from Ajax, we need to reset the events
                $this->RemoveAllActions('onclick');
                if ($this->blnUseAjax) {
                    $this->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'Sort_Click'));
                } else {
                    $this->AddAction(new QClickEvent(), new QServerControlAction($this, 'Sort_Click'));
                }
                $this->AddAction(new QClickEvent(), new QTerminateAction());
                return $blnToReturn;
                // 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 "GridLines":
                try {
                    $this->strGridLines = QType::Cast($mixValue, QType::String);
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
            case "ShowHeader":
                try {
                    $this->blnShowHeader = QType::Cast($mixValue, QType::Boolean);
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
            case "ShowFooter":
                try {
                    $this->blnShowFooter = QType::Cast($mixValue, QType::Boolean);
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
                // MISC
            // MISC
            case "SortColumnIndex":
                try {
                    $this->intSortColumnIndex = QType::Cast($mixValue, QType::Integer);
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
            case "SortDirection":
                if ($mixValue == 1) {
                    $this->intSortDirection = 1;
                } else {
                    $this->intSortDirection = 0;
                }
                break;
            case 'LabelForNoneFound':
                try {
                    $this->strLabelForNoneFound = QType::Cast($mixValue, QType::String);
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
            case 'LabelForOneFound':
                try {
                    $this->strLabelForOneFound = QType::Cast($mixValue, QType::String);
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
            case 'LabelForMultipleFound':
                try {
                    $this->strLabelForMultipleFound = QType::Cast($mixValue, QType::String);
                    break;
                } catch (QInvalidCastException $objExc) {
                    $objExc->IncrementOffset();
                    throw $objExc;
                }
            case 'LabelForPaginated':
                try {
                    $this->strLabelForPaginated = 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;
                }
        }
    }

Usage Example

 public function __set($strName, $mixValue)
 {
     switch ($strName) {
         case "ShowColumnToggle":
             try {
                 $this->blnShowColumnToggle = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "ShowCheckboxes":
             try {
                 $this->blnShowCheckboxes = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "ShowExportCsv":
             try {
                 $this->blnShowExportCsv = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "ExportCsv":
             try {
                 $this->blnExportCsv = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         case "blnModified":
             try {
                 $this->blnModified = QType::Cast($mixValue, QType::Boolean);
                 break;
             } catch (QInvalidCastException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
         default:
             try {
                 parent::__set($strName, $mixValue);
                 break;
             } catch (QCallerException $objExc) {
                 $objExc->IncrementOffset();
                 throw $objExc;
             }
     }
 }