public function transform($groups)
    {
        $value = array();

        if ($groups instanceof Collection) {
            foreach($groups as $group) {
                $value[$group->getId()] = array('group' => true);
            }
        }

        return array('groups_collection' => $value);
    }
public function transform($groups)
    {
        $value = array();

        if ($groups instanceof Collection) {
            foreach($groups as $group) {
                $value[$group->getId()] = array('group' => true);
            }
        }

        return array('groups_collection' => $value);
    }
public function transform ( $ groups ) { $ value = array ( ) ; if ( $ groups instanceof Collection ) { foreach ( $ groups as $ group ) { $ value [ $ group -> getId ( ) ] = array ( 'group' => true ) ; } } return array ( 'groups_collection' => $ value ) ; }
Transform an ArrayCollection of groups to array of group id

@param ArrayCollection $groups

@return array
Transform an ArrayCollection of groups to array of group id