concrete/src/Validator/String/ReuseValidator.php
private function hasBeenUsed($string, $id)
    {
        $repository = $this->entityManager->getRepository(UsedString::class);
        $allUses = $repository->findBy(['subject' => $id], ['id' => 'desc'], $this->maxReuse);

        foreach ($allUses as $use) {
            if ($this->matches($string, $use)) {
                return true;
            }
        }

        return false;
    }
private function hasBeenUsed($string, $id)
    {
        $repository = $this->entityManager->getRepository(UsedString::class);
        $allUses = $repository->findBy(['subject' => $id], ['id' => 'desc'], $this->maxReuse);

        foreach ($allUses as $use) {
            if ($this->matches($string, $use)) {
                return true;
            }
        }

        return false;
    }
private function hasBeenUsed ( $ string , $ id ) { $ repository = $ this -> entityManager -> getRepository ( UsedString :: class ) ; $ allUses = $ repository -> findBy ( [ 'subject' => $ id ] , [ 'id' => 'desc' ] , $ this -> maxReuse ) ; foreach ( $ allUses as $ use ) { if ( $ this -> matches ( $ string , $ use ) ) { return true ; } } return false ; }
Check whether a string has been used against an id

@param string $string
@param int$id

@return bool
Check whether a string has been used against an id