public function merge($document) { if (!is_object($document)) { throw new \InvalidArgumentException(gettype($document)); } $this->errorIfClosed(); return $this->unitOfWork->merge($document); }