Sets the object as a collection casted to a simple array
 collection @users
 collection @users => :people
 collection @users, :root => :person
 collection @users, :object_root => :person
333035
def collection(data, options = {})
      @_collection_name = options[:root] if options[:root]
      @_collection_name ||= data.values.first if data.is_a?(Hash)

      @_object_root_name = options[:object_root] if options.has_key?(:object_root)

      object(data_object(data) || [])
    end
1047077
def user_ids=(values)
      values ||= []
      values = [ values ] unless values.is_a?(::Array)
      values = values.reject{|v| v.blank?}.map{|v| v.to_i}
      self.users = Incline::User.where(id: values).to_a
    end
881933
public function nestedObjectsToArray()
    {
        $attributes = [];

        foreach ($this->getAttributes() as $key => $value) {
            // If the values implements the Arrayable interface we can just call this
            // toArray method on the instances which will convert both objects and
            // collections to their proper array form and we'll set the values.
            if ($value instanceof Arrayable) {
                $attributes[$key] = $value->toArray();
            }
            if (is_array($value)) {
                $attributes[$key] = collect($value)->toArray();
            }
        }

        return $attributes;
    }
938027
def render_collection(collection, member_fields, view = nil, context: Attributor::DEFAULT_ROOT_CONTEXT)
      render(collection, [member_fields], view, context: context)
    end
91588
def set_attribute_data(data, user)
            return {} unless self.can_write_attributes?(data, user)
            data.each_with_object(Hash.new) do | (key, value), result |
                # First we set all the attributes that are allowed

                if self.setting_attribute_is_allowed?(key.to_sym, user)
                    result[key] = value
                    public_send("#{key}=", value)
                elsif value.present?
                    # allow nested params to be specified using Rails _attributes
                    name = key.to_s.gsub(/_attributes$/,'').to_sym

                    next unless self.class.has_exported_nested_attribute?(name, user)

                    association = self.association(name)
                    if value.is_a?(Hash) && [:belongs_to,:has_one].include?(association.reflection.macro)
                        target = send(name) || association.build
                        result[name] = target.set_attribute_data(value, user)
                    elsif value.is_a?(Array) && :has_many == association.reflection.macro
                        result[name] = _set_attribute_data_from_collection(association, name, value, user)
                    end
                end
            end
        end
814683
def to_hash
      @relations.each_with_object({}) do |(rel,val), obj|
        rel = rel.to_s

        hashed_val = val.map(&:to_hash)
        if val.length == 1 && !single_item_arrays?
          hashed_val = val.first.to_hash
        end

        obj[rel] = hashed_val
      end
    end
83193
def set_response(item_class_name)
      if @api_response.success?
        @total_count = @api_response["totalCount"]
        @total_pages = @api_response["totalPages"]
        @count = @api_response["count"]
        @timestamp = @api_response["timestamp"]
        @items = []
        unless @api_response["collection"].nil?
          @api_response["collection"].each do |attr_item|
            item = item_class_name.new
            item.set_item(attr_item)
            @items << item
          end
        end
      else
        @error = @api_response.parsed_response
      end
    end
623094
def users(options = {})
      batches = Enumerator.new do |y|
        options = options.merge(group_name: @name)
        resp = @client.get_group(options)
        resp.each_page do |page|
          batch = []
          page.data.users.each do |u|
            batch << User.new(
              name: u.user_name,
              data: u,
              client: @client
            )
          end
          y.yield(batch)
        end
      end
      User::Collection.new(batches)
    end
253147
def build_objects_by_subject
      @objects = []
      @objects_by_subject = {}

      @reader.statements_by_subject.each do |subject, statements|
        object = Grom::Node.new(statements, @decorators)
        @objects_by_subject[subject] = object
        @objects << object
      end

      self
    end
952317
function _initCollections() {
    if (!this._collections) {
      return;
    }

    for (var coll in this._collections) {
      this[coll] = new this._collections[coll](null, { parent: this, parse: true });
    }
  }
289654
public void setUsers(java.util.Collection<ListedUser> users) {
        if (users == null) {
            this.users = null;
            return;
        }

        this.users = new java.util.ArrayList<ListedUser>(users);
    }
1125649
public void setUsers(java.util.Collection<UserData> users) {
        if (users == null) {
            this.users = null;
            return;
        }

        this.users = new java.util.ArrayList<UserData>(users);
    }
1051523
protected function convertJsonCollectionToArray()
    {
        if (!is_array($this->value) && is_object($this->value)) {
            $orientObjects = array();

            $refClass = new \ReflectionObject($this->value);
            $properties = $refClass->getProperties(\ReflectionProperty::IS_PUBLIC);

            foreach ($properties as $property) {
                $orientObjects[$property->name] = $this->value->{$property->name};
            }

            $this->setValue($orientObjects);
        }
    }
657050
public void put(String key, Object object) {
//        canWrite() TODO disabled for now;

        updateModifiedDate();
        user_data.put(key,object);

//        if(isCollection(object)){
//            Object[] array = ((Collection) object).toArray(new Object[0]);
//            user_data.put(key, array);
//        }
//        else if(isArray(object)){
//            Object[] array = (Object[]) object;
//            user_data.put(key, array);
//        } else {
//            user_data.put(key,object);
//        }
    }
594334
def child(data, options = {}, &block)
        return unless data.present? && resolve_condition(options)

        name   = is_name_value?(options[:root]) ? options[:root] : data_name(data)
        object = data_object(data)

        engine_options = @options.slice(:child_root)
        engine_options[:root] = is_collection?(object) && options.fetch(:object_root, @options[:child_root]) # child @users
        engine_options[:object_root_name] = options[:object_root] if is_name_value?(options[:object_root])

        object = { object => name } if data.is_a?(Hash) && object # child :users => :people

        engines << { create_key(name) => object_to_engine(object, engine_options, &block) }
      end
25085
function objectToArray(o, order) {
    order = order || Object.keys(o);

    return order.map(function(k) {
      return o[k];
    });
  }
748267
def collection_attributes(*attrs)
      @collection_attributes ||= []
      if attrs.any?
        @collection_attributes.map!(&:to_sym).concat(attrs).uniq!
        @collection_attributes.each { |a| setup_collection(a) }
      end
      @collection_attributes
    end