/**
  * @DI\Observe("user_created_event")
  *
  * @param CreateFormResourceEvent $event
  */
 public function onUserCreated(UserCreatedEvent $event)
 {
     $user = $event->getUser();
     if ($this->chatManager->isConfigured()) {
         $this->chatManager->importUser($user);
     }
 }
Exemple #2
0
 /**
  * @DI\Observe("user_created_event")
  *
  * @param UserCreatedEvent $event
  */
 public function onUserCreated(UserCreatedEvent $event)
 {
     $user = $event->getUser();
     $session = $this->container->get('session');
     if ($session->has('partner_code')) {
         $code = $session->get('partner_code');
         $em = $this->container->get('doctrine.orm.entity_manager');
         $partner = $em->getRepository('FormaLibre\\InvoiceBundle\\Entity\\Partner')->findOneByCode('SUPER');
         if ($partner) {
             $partner->addUser($user);
             $em->persist($partner);
             $em->flush();
         }
     }
 }