public function __set($name, $value)
{
switch ($name) {
case 'nextElementSibling':
case 'previousElementSibling':
throw new \BadMethodCallException(sprintf('Can not write readonly property %s::$%s.', get_class($this), $name));
}
$this->setParentProperty($name, $value);
}