private function createEditForm(Advert $entity)
    {
        
        $formConfig = array();
        $user = $this->container->get('security.token_storage')->getToken()->getUser();  
        if ($user->isGranted('ROLE_ADMIN') || $user->isGranted('ROLE_SUPER_ADMIN')) {
            $formConfig['admin'] = true;
        }
        $form = $this->createForm('EcommerceBundle\Form\AdvertEditType', $entity, array_merge($formConfig, array(
            'action' => $this->generateUrl('ecommerce_advert_edit', array('id' => $entity->getId())),
            'method' => 'POST',
        )));
        
        return $form;
    }