items = array_merge($this->items, $items); } public function __get($name) { return $this->items[$name] ?? null; } public function __set($name, $value) { $this->items[$name] = $value; $this->syncAttributes(); } public function __isset($name) { return isset($this->items[$name]); } public function __unset($name) { unset($this->items[$name]); $this->syncAttributes(); } public function isSynchronized(): bool { return $this->isSynchronized; } public function toArray(): array { return $this->items; } public function syncAttributes(): void { $this->isSynchronized = false; $this->model->syncAttributes(); $this->isSynchronized = true; } }