public function complete(UserInterface $user, $code, $password)
    {
        $reminder = $this->findIncomplete($user, $code);

        if ($reminder === null)
        {
            return false;
        }

        $credentials = ['password' => $password];

        if (! $this->users->validForUpdate($user, $credentials))
        {
            return false;
        }

        $entityManager = $this->getEntityManager();
        $entityManager->beginTransaction();

        try
        {
            $this->users->update($user, $credentials);

            $reminder->complete();
            $this->save($reminder);

            $entityManager->commit();
            return true;
        }
        catch (\Exception $e)
        {
            $entityManager->rollback();

            return false;
        }
    }
public function complete(UserInterface $user, $code, $password)
    {
        $reminder = $this->findIncomplete($user, $code);

        if ($reminder === null)
        {
            return false;
        }

        $credentials = ['password' => $password];

        if (! $this->users->validForUpdate($user, $credentials))
        {
            return false;
        }

        $entityManager = $this->getEntityManager();
        $entityManager->beginTransaction();

        try
        {
            $this->users->update($user, $credentials);

            $reminder->complete();
            $this->save($reminder);

            $entityManager->commit();
            return true;
        }
        catch (\Exception $e)
        {
            $entityManager->rollback();

            return false;
        }
    }
public function complete ( UserInterface $ user , $ code , $ password ) { $ reminder = $ this -> findIncomplete ( $ user , $ code ) ; if ( $ reminder === null ) { return false ; } $ credentials = [ 'password' => $ password ] ; if ( ! $ this -> users -> validForUpdate ( $ user , $ credentials ) ) { return false ; } $ entityManager = $ this -> getEntityManager ( ) ; $ entityManager -> beginTransaction ( ) ; try { $ this -> users -> update ( $ user , $ credentials ) ; $ reminder -> complete ( ) ; $ this -> save ( $ reminder ) ; $ entityManager -> commit ( ) ; return true ; } catch ( \ Exception $ e ) { $ entityManager -> rollback ( ) ; return false ; } }
Complete reminder for the given user.

@param  User   $user
@param  string $code
@param  string $password

@return bool
Complete reminder for the given user .