Fill attributes that can be filled.

@param $data

@return void
975608
public function fill(array $data)
    {
        $this->attributes = array_merge($this->attributes, $this->filterFillable($data));
    }
509014
function put($data)
    {
        if ($this->_change == self::STATE_INSERT)
        {
            $this->_change = self::STATE_UPDATE;
            $this->_update = $data;
        }
        elseif ($this->_change == self::STATE_EMPTY)
        {
            $this->_change = self::STATE_INSERT;
            $this->_data = $data;
        }
    }
243364
public function fill($attributes)
    {
        foreach ($attributes as $key => $value) {
            if (in_array($key, $this->fillable)) {
                $this->{$key} = $value;
            }
        }
    }
77817
public function setData($data)
    {
        $this->originalData = $data;

        if ($data instanceof \Iterator) {
            $this->iterator = $data;
        }
        elseif (is_array($data)) {
            $this->iterator = new \ArrayIterator($data);
        }
        else {
            $this->iterator = new \ArrayIterator(array($data));
        }
    }
629759
public function fill(array $data)
    {
        foreach ($data as $key => &$row) {
            $this->original = $value = array_get($row, $this->name);

            $value = $this->htmlEntityEncode($value);

            array_set($row, $this->name, $value);

            if ($this->isDefinedColumn()) {
                $this->useDefinedColumn();
            }

            if ($this->hasDisplayCallbacks()) {
                $value = $this->callDisplayCallbacks($this->original, $key);
                array_set($row, $this->name, $value);
            }
        }

        return $data;
    }
912520
public function set_data( $data ) {

		foreach ( $this->child as $child ) {
			if ( method_exists( $child, 'set_data' ) ) {
				$child->set_data( $data );
			}
		}
		$this->data = $data;

	}
1043030
public function php($data)
    {
        foreach ($this->fieldNames as $fieldName) {
            if (empty($data[$fieldName])) {
                return;
            }

            $this->validateField($fieldName, $data[$fieldName]);
        }
    }
203025
public function update($data) {
        global $DB;
        $currentgrade = $this->get_guide_filling();
        parent::update($data);

        foreach ($data['criteria'] as $criterionid => $record) {
            if (!array_key_exists($criterionid, $currentgrade['criteria'])) {
                $newrecord = array('instanceid' => $this->get_id(), 'criterionid' => $criterionid,
                    'score' => $record['score'], 'remarkformat' => FORMAT_MOODLE);
                if (isset($record['remark'])) {
                    $newrecord['remark'] = $record['remark'];
                }
                $DB->insert_record('gradingform_guide_fillings', $newrecord);
            } else {
                $newrecord = array('id' => $currentgrade['criteria'][$criterionid]['id']);
                foreach (array('score', 'remark'/*, 'remarkformat' TODO */) as $key) {
                    if (isset($record[$key]) && $currentgrade['criteria'][$criterionid][$key] != $record[$key]) {
                        $newrecord[$key] = $record[$key];
                    }
                }
                if (count($newrecord) > 1) {
                    $DB->update_record('gradingform_guide_fillings', $newrecord);
                }
            }
        }
        foreach ($currentgrade['criteria'] as $criterionid => $record) {
            if (!array_key_exists($criterionid, $data['criteria'])) {
                $DB->delete_records('gradingform_guide_fillings', array('id' => $record['id']));
            }
        }
        $this->get_guide_filling(true);
    }
734669
protected function fillDataForEmpty()
    {
        // Fill list references if they are empty
        $columns = [];

        // Add columns for attributes
        foreach ($this->info->attributes as $attribute) {

            if ($attribute->hidden || ! $this->shouldAttributeBeDisplayedByDefault($attribute, $this->info)) {
                continue;
            }

            $columns[ $attribute->name ] = $this->makeModelListColumnDataForAttributeData($attribute, $this->info);
        }

        // Add columns for relations?
        // Perhaps, though it may be fine to leave this up to manual configuration.
        // todo: consider


        $this->info->list->columns = $columns;
    }
974267
public function fill($data)
    {
        if (!$this->object) {
            throw new InvalidArgumentException(
                'There are no object to be mapped'
            );
        }

        if (!is_object($data)) {
            throw new InvalidArgumentException('Data should be an object');
        }

        $data = $this->extractData($data);
        $allowed = $this->extractAllowedAttributes($this->class);

        foreach ($this->class->getProperties() as $property) {
            $name = $property->getName();
            if (!in_array($name, $allowed, true)
                || !array_key_exists(
                    $name,
                    $data
                )
            ) {
                continue;
            }

            $property->setAccessible(true);
            $property->setValue($this->object, $data[$name]);
        }

        return $this->object;
    }
26762
public static function setDataAttributes($data)
    {
        if(is_array($data) && count($data) > 0)
        {
            $keys = array_keys($data);

            $response = '';
            foreach($keys as $key)
            {
                $response .= ' data-' . $key . '="' . $data[$key] . '"';
            }

            return $response;
        }

        return null;
    }
34846
public function fill($data)
    {
        // Field value is already setted.
//        if (!is_null($this->value)) {
//            return;
//        }

        if (is_array($this->column)) {
            foreach ($this->column as $key => $column) {
                $this->value[$key] = array_get($data, $column);
            }

            return;
        }

        $this->value = array_get($data, $this->column);
    }
469557
public function fill(array $data)
    {
        if (isset($data['failures'])) {
            $this->failures = $data['failures'];
        }

        if (isset($data['rules'])) {
            $this->setRules($data['rules']);
        }

        if (isset($data['validator_class'])) {
            $this->setValidatorClass($data['validator_class']);
        }

        return $this;
    }
837896
public function write(string $data) : void
    {
        $this->buffer .= $data;

        if (strlen($this->buffer) >= $this->size) {
            $this->flush();
        }
    }
1289050
protected function fillDataForEmpty()
    {
        // Fill field references if they are empty
        $fields = [];

        // Add columns for attributes
        foreach ($this->info->attributes as $attribute) {

            if ($attribute->hidden || ! $this->shouldAttributeBeEditableByDefault($attribute, $this->info)) {
                continue;
            }

            $fields[ $attribute->name ] = $this->makeModelFormFieldDataForAttributeData($attribute);
        }


        // Add fields for relations
        foreach ($this->info->relations as $relation) {

            $fields[ $relation->name ] = $this->makeModelFormFieldDataForRelationData($relation);
        }


        $this->info->form->fields = $fields;
    }
227168
public function fill(array $data)
    {
        foreach ($data as $key => &$row) {
            $this->original = $value = Arr::get($row, $this->name);

            $value = $this->htmlEntityEncode($value);

            Arr::set($row, $this->name, $value);

            if ($this->isDefinedColumn()) {
                $this->useDefinedColumn();
            }

            if ($this->hasDisplayCallbacks()) {
                $value = $this->callDisplayCallbacks($this->original, $key);
                Arr::set($row, $this->name, $value);
            }
        }

        return $data;
    }
447029
protected function fillAttributes($resource, array $attributes)
    {
        foreach ($attributes as $attribute => $value) {
            $setter = "set" . ucfirst($attribute);

            if (method_exists($resource, $setter)) {
                $resource->$setter($value);
            }
        }
    }