Form/DataTransformer/CustomFieldsGroupToIdTransformer.php
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();
    }
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();
    }
Transforms an custom_field_group to a string (id)

@param  CustomFieldsGroup|null $customFieldsGroup
@return string