public function updateLastLogin(InteractiveLoginEvent $event)
    {
        $user = $event
            ->getAuthenticationToken()
            ->getUser();

        if ($user instanceof LastLoginInterface) {
            $now = $this
                ->dateTimeFactory
                ->create();

            $user->setLastLoginAt($now);

            $this
                ->objectManagerProvider
                ->getManagerByEntityNamespace(get_class($user))
                ->flush($user);
        }

        return $this;
    }
public function updateLastLogin(InteractiveLoginEvent $event)
    {
        $user = $event
            ->getAuthenticationToken()
            ->getUser();

        if ($user instanceof LastLoginInterface) {
            $now = $this
                ->dateTimeFactory
                ->create();

            $user->setLastLoginAt($now);

            $this
                ->objectManagerProvider
                ->getManagerByEntityNamespace(get_class($user))
                ->flush($user);
        }

        return $this;
    }
public function updateLastLogin ( InteractiveLoginEvent $ event ) { $ user = $ event -> getAuthenticationToken ( ) -> getUser ( ) ; if ( $ user instanceof LastLoginInterface ) { $ now = $ this -> dateTimeFactory -> create ( ) ; $ user -> setLastLoginAt ( $ now ) ; $ this -> objectManagerProvider -> getManagerByEntityNamespace ( get_class ( $ user ) ) -> flush ( $ user ) ; } return $ this ; }
Update last login date.

@param InteractiveLoginEvent $event Interactive login event

@return $this Self object
Update last login date .