@param UserEvent $event

@return mixed
182658
public function resolve($event)
    {
        if ($event instanceof UserEvent) {
            return $this->getEventDetailsArray($event->getUser()->getUsername());
        }

        return null;
    }
1131037
public function onPreUpdate(UserEvent $event)
    {
        /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
        $user = $event->getResource();

        $this->userManager->updatePassword($user);
        $this->userManager->updateCanonicalFields($user);
    }
1194422
public function processKick(UserEvent $event, Queue $queue)
    {
        $logger = $this->getLogger();

        $server = strtolower($event->getConnection()->getServerHostname());
        $params = $event->getParams();
        $channel = $params['channel'];
        $nick = $params['user'];
        $message = isset($params['comment']) ? $params['comment'] : null;

        if ($nick == $event->getConnection()->getNickname()) {
            $logger->debug('Removing channel', array('server' => $server, 'channel' => $channel));
            unset($this->channels[$server][$channel]);
            return;
        }

        $logger->debug('Processing incoming KICK', array(
            'server' => $server,
            'channel' => $channel,
            'nick' => $nick,
            'message' => $message,
        ));

        unset($this->channels[$server][$channel][$nick]);

        try {
            $this->db->fetchAssoc(self::SQL_UPDATE, array(
                ':time' => time(),
                ':server' => $server,
                ':channel' => $channel,
                ':nick' => $nick,
                ':type' => self::TYPE_KICK,
                ':text' => $message,
            ));
        } catch (\Exception $e) {
            $logger->error($e->getMessage());
        }
    }
41052
public function onPostCreate(UserEvent $event)
    {
        if (!$event->hasData('password')) {
            return;
        }

        /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
        $user = $event->getResource();
        if (!$user->getSendCreationEmail()) {
            return;
        }

        if (0 < $this->mailer->sendCreationEmailMessage($user, $event->getData('password'))) {
            $event->addMessage(new ResourceMessage('ekyna_user.user.event.credentials_sent'));
        }
    }
1374166
public function postCreate(CreateEvent $event)
    {
        $message = $event->getObject();
        $forum = $message->getSubject()->getForum();

        $usersValidate = $this->om->getRepository('ClarolineForumBundle:Validation\User')
          ->findBy(['forum' => $forum, 'notified' => true]);

        $toSend = $this->messageManager->create(
          $message->getContent(),
          $message->getSubject()->getTitle(),
          array_map(function ($userValidate) {
              return $userValidate->getUser();
          }, $usersValidate)
        );

        $this->messageManager->send($toSend);

        $usersToNotify = $this->userFinder->find(['workspace' => $forum->getResourceNode()->getWorkspace()->getUuid()]);
        $this->dispatcher->dispatch('log', LogPostMessageEvent::class, [$message, $usersToNotify]);

        return $message;
    }
930240
public function save(UserStructure $user)
    {
        $event = new Event\Save();
        $event->setUser($user);
        $this->getEventManager()->trigger($event);
        return $event->getResult();
    }
513289
public function preCreate(CreateEvent $event)
    {
        /** @var Group $role */
        $object = $event->getObject();
        $user = $this->tokenStorage->getToken()->getUser();

        if ($user instanceof User) {
            $object->setUser($user);
        } else {
            $object->setUser($this->userManager->getDefaultClarolineUser());
        }
    }
964558
public function replaceEventUser(User $from, User $to)
    {
        $events = $this->om->getRepository('ClarolineAgendaBundle:Event')->findBy(['user' => $from]);

        if (count($events) > 0) {
            foreach ($events as $event) {
                $event->setUser($to);
            }

            $this->om->flush();
        }

        return count($events);
    }
1314241
public function handleEvent(Event $event, UserNotificationEventHandler $service)
    {
        // If our event is the wrong type, just do a null/void return
        if (!$event instanceof DeactivateUser) {
            return;
        }

        $entity = $event->getUserEntity();

        if ($entity) {
            $service->deactivated($event);
        }
    }
1326748
public function col_relatedfullnameuser($event) {
        // Add affected user.
        if (!empty($event->relateduserid) && $username = $this->get_user_fullname($event->relateduserid)) {
            if (empty($this->download)) {
                $params = array('id' => $event->relateduserid);
                if ($event->courseid) {
                    $params['course'] = $event->courseid;
                }
                $username = html_writer::link(new moodle_url('/user/view.php', $params), $username);
            }
        } else {
            $username = '-';
        }
        return $username;
    }
1108506
public function onRegistrationConfirm(GetResponseUserEvent $event)
    {
        if (null === $event->getResponse()) {
            $url = $this->router->generate('fos_user_security_login');
            $event->setResponse(new RedirectResponse($url));
        }
    }
1186913
public function renderEvent(Event $event)
    {
        $parts = array_map('ucfirst', array_filter(preg_split('/_|\./', $event->name)));
        $name = 'on'.implode($parts);

        if (is_callable(array($this, $name))) {
            return call_user_func(array($this, $name), $event);
        } else {
            return null;
        }
    }
36527
public function onUserRegistered(UserRegisteredEvent $event)
    {
        $model = $event->getUser();

        $this->mail->send('Подтверждение регистрации на сайте', $model->email, 'user/mail/registration', [
            'model' => $model,
            'confirm_url' => $this->generator->generate('user_registration_confirm', [
                'token' => $model->token,
            ], UrlGeneratorInterface::ABSOLUTE_URL),
        ]);
    }
1296049
public static function user_deleted(\core\event\user_deleted $event) {
        $userid = $event->objectid;
        subscription_manager::delete_user_subscriptions($userid);
    }
250583
public function getEventLog(Event $event, $eventName)
    {
        $eventLog = $this->getEventLogObject($this->getEventLogInfo($event, $eventName));

        if (null === $eventLog) {
            return null;
        }

        $eventLog->setTypeId($eventName);
        $eventLog->setIp($this->getClientIp());
        $eventLog->setEventTime(new \DateTime());
        $this->setUser($eventLog);

        return $eventLog;
    }
565990
public function destroy(Event $event)
    {
        $this->authorize('delete', $event);
        $event->deleteUsers($event->users);
        $event->delete();

        return redirect()->route('laralum::events.index')
            ->with('success', __('laralum_events::general.event_deleted', ['id' => $event->id]));
    }
460029
public function dispatch(Event $event)
        {
            $message = sprintf(self::FMT_INF_DISPATCHING, $event->getId(), count($this->subscriptions));
            $this->logger->info($message);

            $dispatchCount = 0;

            foreach ($this->subscriptions as $subscription) {
                $result = $this->tryDispatch($subscription, $event);

                $dispatchCount += (int)$result;
            }

            $message = sprintf(self::FMT_INF_DISPATCHED, $event->getId(), $dispatchCount);
            $this->logger->info($message);

            return $dispatchCount;
        }