public function invalidateUnusedTokens(AuthenticationRecordInterface $authenticationRecord)
    {
        $query = $this->getRepository()->createQueryBuilder('r')
            ->update()
            ->set('r.status', UserResetTokenInterface::STATUS_INVALID)
            ->where('r.authentication = :authentication')
            ->andWhere('r.status = :status_unused')
            ->setParameters([
                'authentication' => $authenticationRecord,
                'status_unused' => UserResetTokenInterface::STATUS_UNUSED,
            ])
            ->getQuery();

        $query->execute();
    }
public function invalidateUnusedTokens(AuthenticationRecordInterface $authenticationRecord)
    {
        $query = $this->getRepository()->createQueryBuilder('r')
            ->update()
            ->set('r.status', UserResetTokenInterface::STATUS_INVALID)
            ->where('r.authentication = :authentication')
            ->andWhere('r.status = :status_unused')
            ->setParameters([
                'authentication' => $authenticationRecord,
                'status_unused' => UserResetTokenInterface::STATUS_UNUSED,
            ])
            ->getQuery();

        $query->execute();
    }
public function invalidateUnusedTokens ( AuthenticationRecordInterface $ authenticationRecord ) { $ query = $ this -> getRepository ( ) -> createQueryBuilder ( 'r' ) -> update ( ) -> set ( 'r.status' , UserResetTokenInterface :: STATUS_INVALID ) -> where ( 'r.authentication = :authentication' ) -> andWhere ( 'r.status = :status_unused' ) -> setParameters ( [ 'authentication' => $ authenticationRecord , 'status_unused' => UserResetTokenInterface :: STATUS_UNUSED , ] ) -> getQuery ( ) ; $ query -> execute ( ) ; }
Modify previously created tokens that are not used, so that their status is invalid. There should only be one
valid token at any time.

@param AuthenticationRecordInterface $authenticationRecord

@return mixed
Modify previously created tokens that are not used so that their status is invalid . There should only be one valid token at any time .