public function create()
{
try {
$this->db->insert("documents", ["key" => $this->model->getKey(), "path" => $this->model->getRealPath(), "parentId" => $this->model->getParentId(), "index" => 0]);
$date = time();
$this->model->setId($this->db->lastInsertId());
if (!$this->model->getKey()) {
$this->model->setKey($this->model->getId());
}
} catch (\Exception $e) {
throw $e;
}
}