public function getById($id)
{
try {
$data = $this->db->fetchRow("SELECT documents.*, tree_locks.locked FROM documents\n LEFT JOIN tree_locks ON documents.id = tree_locks.id AND tree_locks.type = 'document'\n WHERE documents.id = ?", $id);
} catch (\Exception $e) {
}
if ($data["id"] > 0) {
$this->assignVariablesToModel($data);
} else {
throw new \Exception("Document with the ID " . $id . " doesn't exists");
}
}