Contao\DataContainer::__set PHP Method

__set() public method

Set an object property
public __set ( string $strKey, mixed $varValue )
$strKey string
$varValue mixed
    public function __set($strKey, $varValue)
    {
        switch ($strKey) {
            case 'activeRecord':
                $this->objActiveRecord = $varValue;
                break;
            default:
                $this->{$strKey} = $varValue;
                // backwards compatibility
                break;
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Set an object property
  *
  * @param string $strKey
  * @param mixed  $varValue
  */
 public function __set($strKey, $varValue)
 {
     switch ($strKey) {
         case 'createNewVersion':
             $this->blnCreateNewVersion = (bool) $varValue;
             break;
         default:
             parent::__set($strKey, $varValue);
             break;
     }
 }