public function isCategoryAllowed(Category $category)
 {
     return count($this->categories) == 0 || isset($this->categories[$category->getId()]);
 }
 public function findTeamByCategory(Category $category, $name, $division)
 {
     $qb = $this->em->createQuery("select t " . "from " . $this->entity->getRepositoryPath('Enrollment') . " e, " . $this->entity->getRepositoryPath('Team') . " t " . "where e.category=:category and " . "e.team=t.id and " . "t.name=:name and " . "t.division=:division");
     $qb->setParameter('category', $category->getId());
     $qb->setParameter('name', $name);
     $qb->setParameter('division', $division);
     return $qb->getResult();
 }