public function closeAccount()
    {
        if (!$this->session->has('session_id')) {
            throw new RuntimeException('No session to close.');
        }

        if (null !== $session = $this->app['repo.sessions']->find($this->session->get('session_id'))) {
            $this->em->remove($session);
            $this->em->flush();
        }

        $this->session->invalidate();
        $this->reinitUser();

        return $this;
    }
public function closeAccount()
    {
        if (!$this->session->has('session_id')) {
            throw new RuntimeException('No session to close.');
        }

        if (null !== $session = $this->app['repo.sessions']->find($this->session->get('session_id'))) {
            $this->em->remove($session);
            $this->em->flush();
        }

        $this->session->invalidate();
        $this->reinitUser();

        return $this;
    }
public function closeAccount ( ) { if ( ! $ this -> session -> has ( 'session_id' ) ) { throw new RuntimeException ( 'No session to close.' ) ; } if ( null !== $ session = $ this -> app [ 'repo.sessions' ] -> find ( $ this -> session -> get ( 'session_id' ) ) ) { $ this -> em -> remove ( $ session ) ; $ this -> em -> flush ( ) ; } $ this -> session -> invalidate ( ) ; $ this -> reinitUser ( ) ; return $ this ; }
Closes user session
Closes user session