protected function findEntityByBusinessEntityAndAttribute(BusinessEntity $businessEntity, $attributeName, $attributeValue)
    {
        if (!$this->entityManager) {
            throw new \Exception('EntityManager not defined, you should use the "victoire_core.helper.queriable_business_entity_helper" service');
        }
        //retrieve the class of the business entity
        $class = $businessEntity->getClass();

        //get the repository
        $repo = $this->entityManager->getRepository($class);

        $functionName = 'findOneBy'.ucfirst($attributeName);

        //get the entity
        $entity = call_user_func([$repo, $functionName], $attributeValue);

        return $entity;
    }