/**
  * Get all the categories from with the same given direct parent
  * @param int $catId Category parent ID
  * @return array Array of Category objects
  */
 public function getCategories($catId)
 {
     $catId = intval($catId);
     $em = Database::getManager();
     $results = $em->getRepository('ChamiloCoreBundle:GradebookCategory')->findBy(['parentId' => $catId]);
     $allcats = Category::createCategoryObjectsFromEntities($results);
     return $allcats;
 }