public function createAction()
    {
        $group = new Group();

        $form = $this->createForm(GroupType::class, $group);
        $form->bindRequest($this->getRequest());

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($group);
            $em->flush();

            $this->get('session')->getFlashBag()->set('success', 'The group has been created.');

            return $this->redirect($this->generateUrl('orkestra_group_show', array('id' => $group->getId())));

        }

        return array(
            'group' => $group,
            'form' => $form->createView()
        );
    }