/** * Capture __unset() to make sure no read-only properties are erased * * @param string $property */ public function __unset($property) { // make sure we're not unsetting a read-only value if (in_array($property, static::tree_config('read-only'))) { throw new \InvalidArgumentException('Property "' . $property . '" is read-only and can not be changed'); } parent::__unset($property); }