public function getById($id)
{
$data = $this->db->fetchRow("SELECT objects.*, tree_locks.locked as o_locked FROM objects\n LEFT JOIN tree_locks ON objects.o_id = tree_locks.id AND tree_locks.type = 'object'\n WHERE o_id = ?", $id);
if ($data["o_id"]) {
$this->assignVariablesToModel($data);
} else {
throw new \Exception("Object with the ID " . $id . " doesn't exists");
}
}