public static function group(Api\GroupCreate $group)
    {
        $fields = [];

        if ($group->getName() != null) {
            $fields['name'] = $group->getName();
        }

        if (!empty($group->getMembers())) {
            $fields['members'] = $group->getMembers();
        }

        if (!empty($group->getChildGroups())) {
            $fields['child_groups'] = $group->getChildGroups();
        }

        if ($group->getAutoUpdate() != null) {
            $fields['auto_update'] = Serialize::_groupAutoUpdateHelper(
                $group->getAutoUpdate()
            );
        }

        if (!empty($group->getTags())) {
            $fields['tags'] = $group->getTags();
        }

        return Serialize::_toJson($fields);
    }
public static function group(Api\GroupCreate $group)
    {
        $fields = [];

        if ($group->getName() != null) {
            $fields['name'] = $group->getName();
        }

        if (!empty($group->getMembers())) {
            $fields['members'] = $group->getMembers();
        }

        if (!empty($group->getChildGroups())) {
            $fields['child_groups'] = $group->getChildGroups();
        }

        if ($group->getAutoUpdate() != null) {
            $fields['auto_update'] = Serialize::_groupAutoUpdateHelper(
                $group->getAutoUpdate()
            );
        }

        if (!empty($group->getTags())) {
            $fields['tags'] = $group->getTags();
        }

        return Serialize::_toJson($fields);
    }
public static function group ( Api \ GroupCreate $ group ) { $ fields = [ ] ; if ( $ group -> getName ( ) != null ) { $ fields [ 'name' ] = $ group -> getName ( ) ; } if ( ! empty ( $ group -> getMembers ( ) ) ) { $ fields [ 'members' ] = $ group -> getMembers ( ) ; } if ( ! empty ( $ group -> getChildGroups ( ) ) ) { $ fields [ 'child_groups' ] = $ group -> getChildGroups ( ) ; } if ( $ group -> getAutoUpdate ( ) != null ) { $ fields [ 'auto_update' ] = Serialize :: _groupAutoUpdateHelper ( $ group -> getAutoUpdate ( ) ) ; } if ( ! empty ( $ group -> getTags ( ) ) ) { $ fields [ 'tags' ] = $ group -> getTags ( ) ; } return Serialize :: _toJson ( $ fields ) ; }
Serializes the given group create object to JSON.

@param Api\GroupCreate $group the group to serialize

@return string a JSON string
Serializes the given group create object to JSON .