code: public function findByUsedInEntity($entityId, $entityType)
      {
          $qb = $this->createQueryBuilder();
  
          $qb->field('useReferences.' . $entityType . '.' . $entityId)->exists('true');
  
          return $qb->getQuery()->execute();
      }
docs: @param string $entityId
  @param string $entityType
  
  @return array