public function hasChildren() { $c = $this->db->fetchOne("SELECT id FROM documents WHERE parentId = ? LIMIT 1", $this->model->getId()); return (bool) $c; }