src/Utils/CustomFieldRepoService.php
public function getEntitiesIdsForCustomFieldId($entityClass, $customFieldId)
    {
        $qb = $this->mr->getManager()->getRepository($entityClass)->createQueryBuilder('e');
        $qb->join('e.customFields', 'cf')
           ->select('e.id')
           ->where('cf.id = :id')
           ->setParameter('id', $customFieldId);
        $result = $qb->getQuery()->getScalarResult();

        return array_column($result, 'id');
    }
public function getEntitiesIdsForCustomFieldId($entityClass, $customFieldId)
    {
        $qb = $this->mr->getManager()->getRepository($entityClass)->createQueryBuilder('e');
        $qb->join('e.customFields', 'cf')
           ->select('e.id')
           ->where('cf.id = :id')
           ->setParameter('id', $customFieldId);
        $result = $qb->getQuery()->getScalarResult();

        return array_column($result, 'id');
    }
public function getEntitiesIdsForCustomFieldId ( $ entityClass , $ customFieldId ) { $ qb = $ this -> mr -> getManager ( ) -> getRepository ( $ entityClass ) -> createQueryBuilder ( 'e' ) ; $ qb -> join ( 'e.customFields' , 'cf' ) -> select ( 'e.id' ) -> where ( 'cf.id = :id' ) -> setParameter ( 'id' , $ customFieldId ) ; $ result = $ qb -> getQuery ( ) -> getScalarResult ( ) ; return array_column ( $ result , 'id' ) ; }
Retrieves all entities from a given class which are linked to a specific CustomField

@param string $entityClass   Must be an entity stored in the database
@param int    $customFieldId The ID of the customField base entity to match with

@return array        Contains all found entity IDs which point to the customFieldId
Retrieves all entities from a given class which are linked to a specific CustomField