code: public function transform($customFieldsGroup)
      {
          if (null === $customFieldsGroup) {
              return "";
          }
          
          if (!$customFieldsGroup instanceof CustomFieldsGroup) {
              throw new TransformationFailedException(sprintf('Transformation failed: '
                    . 'the expected type of the transforme function is an '
                    . 'object of type Chill\CustomFieldsBundle\Entity\CustomFieldsGroup, '
                    . '%s given (value : %s)', gettype($customFieldsGroup), 
                    $customFieldsGroup));
          }
  
          return $customFieldsGroup->getId();
      }
docs: Transforms an custom_field_group to a string (id)
  
  @param  CustomFieldsGroup|null $customFieldsGroup
  @return string