/**
  * Установка строки со специализациями курса
  */
 private function setSpecializations(Course $course, array $specialties)
 {
     $em = $this->getDoctrine()->getManager();
     $repo = $em->getRepository('LearningMainBundle:Specialization');
     $specCollection = new ArrayCollection();
     $specTitles = array();
     foreach ($specialties as $specId) {
         $specialty = $repo->findOneById($specId);
         $specCollection[] = $repo->findOneById($specId);
         $specTitles[] = $specialty->getTitle();
     }
     $specialtiesStr = implode(' | ', $specTitles);
     $course->setSpecializations($specCollection);
     $course->setSpecializationsStr($specialtiesStr);
 }