code: private function getDefaultGroupsId()
      {
          $em = $this->getDoctrine()->getManager();
          
          $customFieldsGroupIds = $em->createQuery('SELECT g.id FROM '
                  . 'ChillCustomFieldsBundle:CustomFieldsDefaultGroup d '
                  . 'JOIN d.customFieldsGroup g')
                  ->getResult(Query::HYDRATE_SCALAR);
          
          $result = array();
          foreach ($customFieldsGroupIds as $row) {
              $result[] = $row['id'];
          }
          
          return $result;
      }
docs: Get an array of CustomFieldsGroupId which are marked as default
  for their entity
  
  @return int[]