public function offsetSet($index, $value) { if (!parent::offsetExists($index)) { throw new PropertyReadOnlyException($index, __CLASS__); } parent::offsetSet($index, $value); }