Add additional calculated data fields to be used on this GridField

@param array $fields a map of fieldname to callback. The callback will
be passed the record as an argument.
542419
public function addDataFields($fields)
    {
        if ($this->customDataFields) {
            $this->customDataFields = array_merge($this->customDataFields, $fields);
        } else {
            $this->customDataFields = $fields;
        }
    }
183000
public function addValues(array $fieldValues)
    {
        foreach ($fieldValues as $fieldName => $values) {
            $values = Arr::cast($values);
            if (null === ($field = $this->getField($fieldName))) {
                $message = "unknown field";
                $len = count($values);
                if ($len !== 1) {
                    $message .= " (encountered $len values)";
                }
                $error = new Error($message);
                $error->setName($fieldName);
                $this->addError($error);
            }
            else {
                foreach ($values as $index => $value) {
                    $field->addValue($value, $index);
                }   
            }
        }
    }
482086
public function addRows($rows)
    {
        foreach ($rows as $row) {
            $this->inputRows[] = $row;
            $inferredRow = $this->inferRow($row);
            foreach ($this->getFieldNames() as $fieldName) {
                /** @var BaseField $inferredField */
                $inferredField = $inferredRow[$fieldName];
                $inferredFieldType = $inferredField->getInferIdentifier($this->lenient);
                if (!array_key_exists($fieldName, $this->fieldsPopularity)) {
                    $this->fieldsPopularity[$fieldName] = [];
                    $this->fieldsPopularityObjects[$fieldName] = [];
                }
                if (!array_key_exists($inferredFieldType, $this->fieldsPopularity[$fieldName])) {
                    $this->fieldsPopularity[$fieldName][$inferredFieldType] = 0;
                    $this->fieldsPopularityObjects[$fieldName][$inferredFieldType] = $inferredField;
                }
                ++$this->fieldsPopularity[$fieldName][$inferredFieldType];
                arsort($this->fieldsPopularity[$fieldName]);
            }
        }
    }
399886
public function add(array $fields)
    {
        $xml = "<employee>";

        foreach ($fields as $field => $value) {
            $xml .= "<field id=\"{$field}\">{$value}</field>";
        }

        $xml .= "</employee>";

        return $this->post("employees", $xml);
    }
113602
public function fields($fields) {
        if (!is_array($fields)) {
            $fields = func_get_args();
        }

        $this->_fields = $fields;

        return $this;
    }
80536
public function addFields(array $pFields)
    {
        $fields        = $this->_prefixFields($pFields);
        $this->_fields = array_merge($fields, $this->_fields);
        return $this;
    }
1003295
function setValues (array $values = array())
    {
        foreach ($this->getFields() as $field)
            if (array_key_exists($field->getName(), $values))
                $field->setValue($values[$field->getName()]);
        foreach ($this->dataFields as $dataKey => $dataVal)
            if (array_key_exists($dataKey, $values))
                $this->dataFields[$dataKey] = $values[$dataKey];
    }
649549
public function prepareInsertFields(array $fields)
    {
        if ($this->isSortEnabled()) {
            $fields[$this->sortIndexFieldName] = $this->getMaxSortIndex() + 1;
        }
        
        return $fields;
    }
1272515
public function add_fields( $fields )
	{
		if ( !is_array( $fields ) )
		{
			$fields = array( $fields );
		}
		
		// merge the new values with the existing ones.
		$this->fields = array_merge( $this->fields, $fields ); 
	
		// return self so we can continue running the next function
		return $this;
	}
592066
public function fields(array $fields = null) {
        if ($fields === null) {
            return $this->fields;
        }

        $this->fields = $fields;

        return $this;
    }
1168646
def add_fields(self, fields):
        
        for k, v in fields.items():
            if k not in self._fields:
                self._fields[k] = v
530938
public function setFields(array $fields)
    {
        parent::setFields($fields);
        if (empty($this->batchId)) {
            $this->batchId = null;
        }

        if (isset($fields['_embedded']['messages'])) {
            $this->messages = $fields['_embedded']['messages'];
        }
    }
932440
public function addFields(array $fields)
    {
        collect($fields)->each(function ($field, $key) {
            if (! $field instanceof AttachmentField) {
                $field = [$key => $field];
            }

            $this->addField($field);
        });

        return $this;
    }
1024287
public function setFields($fields = [])
    {
        $existingSchema = $this->get();

        $request = [];
        foreach ($fields as $field) {
            $mode = $this->hasField($field['name'], $existingSchema) ? 'replace-field' : 'add-field';
            $request[$mode][] = $field;
        }

        return $this->request($request);
    }
1131486
public function setFields (array $fields)
    {
        $this->_fields = array();
        $this->_records = array();
        $prevLevel = null;
        foreach ($fields as $field) {
            $level = $field->getLevel();
            if ($level === 0) {
                $this->append($field);
            } else {
                if ($level === 1 && $prevLevel !== 1) {
                    $localRecord = new LocalRecord(array($field));
                    $this->addLocalRecord($localRecord);
                } else {
                    $records = $this->getLocalRecords();
                    // Handle malformed Pica record w/ missing local record field
                    if (empty($records)) {
                        $localRecord = new LocalRecord();
                        $this->addLocalRecord($localRecord);
                    } else {
                        $localRecord = end($records);
                    }
                    if ($level === 1) {
                        $localRecord->append($field);
                    } else {
                        $copyRecord = $localRecord->getCopyRecordByItemNumber($field->getOccurrence());
                        if ($copyRecord) {
                            $copyRecord->append($field);
                        } else {
                            $localRecord->addCopyRecord(new CopyRecord(array($field)));
                        }
                    }
                }
            }
            $prevLevel = $level;
        }
    }
76926
protected function setFields($fields) 
    {
    	foreach ($fields as $name => $value) {
            $property = '_' . $name;
            if (property_exists($this, $property)) $this->$property = $value;
        }
    }
598246
protected function setPostFields (array $fields)
	{
		foreach ($fields as $key => $value) $this->fields[$key] = $value;
	}