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;
    }