public function hasChildren() { try { $amount = (int) $this->db->fetchOne("SELECT COUNT(*) as amount FROM " . self::TABLE_NAME_GROUPS . " where parentId= " . $this->model->id); } catch (\Exception $e) { } return $amount; }