/** * Save this document in the database. * * @throws ? * * @author David Zülke <*****@*****.**> * @since 1.0.0 */ public function save() { if ($this->isNew()) { return $this->database->createDocument($this); } elseif ($this->isModified()) { return $this->database->updateDocument($this); } }