Saves the value of the field into the given data object.

@param DataObjectInterface $record

@throws Exception

@return void
335889
public function saveInto(DataObjectInterface $record)
    {
        // Initialise:
        
        $ids = [];
        
        // Obtain Field Name:
        
        $fieldName = $this->getName();
        
        // Bail Early (if needed):
        
        if (empty($fieldName) || empty($record)) {
            return;
        }
        
        // Obtain Relation:
        
        if (!($relation = $this->getNamedRelation($record))) {
            
            throw new Exception(
                sprintf(
                    '%s does not have a relation named "%s"',
                    get_class($record),
                    $this->Name
                )
            );
            
        }
        
        // Iterate Value Array:
        
        foreach ($this->getValueArray() as $title) {
            
            // Obtain or Create Tag:
            
            if ($tag = $this->findOrMakeTag($relation, $title)) {
                $ids[] = $tag->ID;
            }
            
        }
        
        // Update Relation:
        
        $relation->setByIDList($ids);
    }
166103
public function saveInto(DataObjectInterface $record)
    {
        $name = $this->getName();
        
        if ($record->hasMethod("set{$name}")) {
            
            $record->$name = DBField::create_field('Dimensions', $this->getDimensionValues());
            
        } else {
            
            foreach ($this->getDimensionValues() as $dim => $value) {
                $record->{"{$name}$dim"} = $value;
            }
            
        }
    }
1163134
@Override
	public void collect(Record record)
	{
		try {
			for (int i = 0; i < writers.length; i++) {
				this.writers[i].emit(record);
			}
		}
		catch (IOException e) {
			throw new RuntimeException("Emitting the record caused an I/O exception: " + e.getMessage(), e);
		}
		catch (InterruptedException e) {
			throw new RuntimeException("Emitting the record was interrupted: " + e.getMessage(), e);
		}
	}
51432
public function save($record, $objectType, $matchField = null)
    {
        if ($matchField) {
            $this->addBulkUpsertRecord($record, $objectType, $matchField);
        } elseif (isset($record->Id) && null !== $record->Id) {
            $this->addBulkUpdateRecord($record, $objectType);
        } else {
            $this->addBulkCreateRecord($record, $objectType);
        }

        return $this;
    }
989550
public function setDataPopulation(DataPopulation\DataPopulationInterface $dataPopulation)
    {
        if ($dataPopulation instanceof DataPopulation\Object && $dataPopulation->getObject() === null) {
            throw new \Exception('object is missing in DataPopulation\Object!');
        }

        $this->dataPopulation = $dataPopulation;
    }
1125149
public function saveInto(DataObjectInterface $record)
    {
        if (!$this->actionToExecuteOnSaveInto) {
            return;
        }

        if ($this->actionToExecuteOnSaveInto instanceof FormAction) {
            $this->actionToExecuteOnSaveInto = $this->actionToExecuteOnSaveInto->actionName();
        }

        $funcName = $this->actionToExecuteOnSaveInto;

        if (!$funcName && $defaultAction = $this->inlineForm->defaultAction()) {
            $funcName = $defaultAction->actionName();
        }

        if ($funcName) {
            $this->inlineForm->setButtonClicked($funcName);
        } else {
            if($this->inlineForm->Record) {
                $record = $this->inlineForm->Record;
            }

            $this->unprependName($this->inlineForm->Fields());
            $this->inlineForm->loadDataFrom($this->value);
            $this->inlineForm->saveInto($record);

            return;
        }

        if (
            // Ensure that the action is actually a button or method on the form,
            // and not just a method on the controller.
            (
                $this->form
                && $this->form->Controller
                && $this->form->Controller->hasMethod($funcName)
                && !$this->form->Controller->checkAccessAction($funcName)
                // If a button exists, allow it on the controller
                && !$this->form->dataFieldByName('action_' . $funcName)
            ) &&
            (
                $this->inlineForm
                && $this->inlineForm->Controller
                && $this->inlineForm->Controller->hasMethod($funcName)
                && !$this->inlineForm->Controller->checkAccessAction($funcName)
                // If a button exists, allow it on the controller
                && !$this->inlineForm->dataFieldByName('action_' . $funcName)
            ) &&
            ($this->form->hasMethod($funcName) && !$this->form->checkAccessAction($funcName)) &&
            ($this->inlineForm->hasMethod($funcName) && !$this->inlineForm->checkAccessAction($funcName))
            // No checks for button existence or $allowed_actions is performed -
            // all form methods are callable (e.g. the legacy "callfieldmethod()")
        ) {
            return;
        }

        $this->unprependName($this->inlineForm->Fields());
        $this->inlineForm->loadDataFrom($this->value);
        $request = \Controller::curr()->Request;

        if ($this->inlineForm->Controller->hasMethod($funcName)) {
            $this->inlineForm->Controller->$funcName($this->inlineForm->Data, $this->inlineForm, $request);
            // Otherwise, try a handler method on the form object.
        } elseif ($this->inlineForm->hasMethod($funcName)) {
            $this->inlineForm->$funcName($this->inlineForm->Data, $this->inlineForm, $request);
        } elseif ($this->form && $this->form->Controller->hasMethod($funcName)) {
            $this->form->Controller->$funcName($this->inlineForm->Data, $this->inlineForm, $request);
        } elseif ($this->form && $this->inlineForm->hasMethod($funcName)) {
            $this->form->$funcName($this->inlineForm->Data, $this->inlineForm, $request);
        } elseif ($field = $this->inlineForm->checkFieldsForAction($this->inlineForm->Fields(), $funcName)) {
            $field->$funcName($this->inlineForm->Data, $this->inlineForm, $request);
        }
    }
1003896
protected function write(array $record)
    {
        if ($record['level'] < Logger::NOTICE) {
            $this->handleDebugRecord($record);
        } elseif (isset($record['context']['exception']) && $record['context']['exception'] instanceof Exception) {
            $this->handleExceptionRecord($record);
        } else {
            $this->handleErrorRecord($record);
        }
    }
974538
public function addRecord($id, $record)
    {
        $this->innerXML .= $record;
        if (false === $this->firstHarvestedId) {
            $this->firstHarvestedId = $id;
        }
    }
1373973
protected function getNamedRelation(DataObjectInterface $record)
    {
        return $record->hasMethod($this->Name) ? $record->{$this->Name}() : null;
    }
923481
protected function write(array $record): void
    {
        try
        {
            $body = \json_encode($record);

            // @codeCoverageIgnoreStart
            if (false === \is_string($body))
            {
                return;
            }
            // @codeCoverageIgnoreEnd

            if (true === $this->gzipMessage)
            {
                /** @noinspection UnnecessaryCastingInspection */
                $body = (string) \gzcompress($body);
            }

            $this->outputStream()->write($body);
        }
        // @codeCoverageIgnoreStart
        catch (\Throwable $throwable)
        {
            /** Not interest */
        }
        // @codeCoverageIgnoreEnd
    }
1294850
protected function emit(\Plop\RecordInterface $record)
    {
        try {
            $s = $this->makePickle($record);
            $this->send($s);
        } catch (\Exception $e) {
            $this->handleError($record, $e);
        }
    }
813201
public function validate(EntityInterface $record) {
        $fields = $this->getOption('fields');
        $sql = '1';
        $params = array();
        //Don't check the current object, so add a not on the primary keys
        $primaryKeys = $record->getModelsMetaData()->getPrimaryKeyAttributes($record);
        $columnMap = $record->getModelsMetaData()->getColumnMap($record);
        //Check to see if all of the values are still null
        $someValuesNotNull = false;
        foreach($primaryKeys as $i => $primaryKey) {
            $field = $columnMap[$primaryKey]; //Get shortened version
            $value = $record->readAttribute($field);
            if(!is_null($value)) {
                $someValuesNotNull = true;
            }
        }
        if($someValuesNotNull) {
            $sql .= ' AND NOT (';
            foreach($primaryKeys as $i => $primaryKey) {
                $field = $columnMap[$primaryKey]; //Get shortened version
                $value = $record->readAttribute($field);
                if($i != 0) {
                    $sql .= ' AND';
                }
                $paramKey = sizeOf($params);
                $sql .= ' ' . $field . '=?' . $paramKey;
                $params[] = $value;
            }
            $sql .= ')';
        }
        //Add each field
        foreach($fields as $field) {
            $paramKey = sizeOf($params);
            $value = $record->readAttribute($field);
            $sql .= ' AND ' . $field . '=?' . $paramKey;
            $params[] = $value;
        }
        /** @var ResultSet $resultSet */
        $resultSet = $record->find(
            [
                'conditions' => $sql,
                'bind' => $params,
                'limit' => 1
            ]
        );
        //If one is found, give an
        if($resultSet->count() == 0) {
            return true;
        } else {
            $this->appendMessage($this->getOption('message'));
            return false;
        }

    }
727551
public function save(DomainObjectInterface &$domainObject): void
    {
        if ($domainObject->getId() === 0) {
            $this->concreteInsert($domainObject);
        }

        $this->concreteUpdate($domainObject);
    }
507556
public function saveInto(DataObjectInterface $object) {
		if(!$this->canCrop() || !$this->hasSourceFile()) {
			return;
		}
		$object->setField($this->getName() . 'ID', $this->generateCropped()->ID);
		$object->write();
	}
284355
@Override
	public void writeRecord(Record record) throws IOException {
		try {
			for (int x = 0; x < record.getNumFields(); x++) {
				Value temp = record.getField(x, fieldClasses[x]);
				addValue(x + 1, temp);
			}
			upload.addBatch();
			batchCount++;
			if(batchCount >= batchInterval) {
				upload.executeBatch();
				batchCount = 0;
			}
		} catch (SQLException sqe) {
			throw new IllegalArgumentException("writeRecord() failed:\t", sqe);
		} catch (IllegalArgumentException iae) {
			throw new IllegalArgumentException("writeRecord() failed:\t", iae);
		}
	}
166884
public function populate_from_record($record) {
        foreach ($this->fieldsindb as $field) {
            $this->$field = $record->$field;
        }
        $this->timemodified = $record->timemodified;
    }
211603
public function mapFromObjectToField($data, FieldTypeInterface $field)
    {
        if (! is_object($data)) {
            $this->triggerException();
        }

        $field->setValue(
            $this->propertyAccessor->getValue($data, $field->getBaseName())
        );
    }