Check if data value is updated or not

@param  DataAbstract $data
@param  string       $field
@return bool
@throws \DomainException
552932
protected function isDataUpdated($data, $field)
    {
        if (!isset($this->dataNamesMap[$field]['property'])) {
            throw new \DomainException('Field have not mapping with Data instance (field: ' . $field . ')');
        }

        $property = $this->dataNamesMap[$field]['property'];

        return $data->isUpdated($property);
    }
570960
def has_changed(self, field):
        """"""
        if field in self.fields:
            # deferred fields haven't changed
            if field in self.deferred_fields and field not in self.instance.__dict__:
                return False
            return self.previous(field) != self.get_field_value(field)
        else:
            raise FieldError('field "%s" not tracked' % field)
136759
function update_field() {
        global $DB;

        $DB->update_record('data_fields', $this->field);

        // Trigger an event for updating this field.
        $event = \mod_data\event\field_updated::create(array(
            'objectid' => $this->field->id,
            'context' => $this->context,
            'other' => array(
                'fieldname' => $this->field->name,
                'dataid' => $this->data->id
            )
        ));
        $event->trigger();

        return true;
    }
356368
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case NAME:
      return isSetName();
    case DATA_TYPE:
      return isSetDataType();
    case ENCODING:
      return isSetEncoding();
    case OTHER_ARGS:
      return isSetOtherArgs();
    }
    throw new IllegalStateException();
  }
20512
public function update($field_id, array $data)
    {
        $result = null;
        $this->hook->attach('field.update.before', $field_id, $data, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        unset($data['type']);

        $updated = $this->db->update('field', $data, array('field_id' => $field_id));
        $data['field_id'] = $field_id;
        $updated += (int) $this->setTranslations($data, $this->translation_entity, 'field');

        $result = $updated > 0;
        $this->hook->attach('field.update.after', $field_id, $data, $result, $this);
        return (bool) $result;
    }
666052
protected function propertyHasChanged()
    {
        foreach ($this->dbFields as $field => $value) {
            if (isset($this->fields[$field]) && ($this->fields[$field] != $value)) {
                return true;
            }
        }

        return false;
    }
1204114
public function hasDatabaseField($field)
    {
        $spec = static::getSchema()->fieldSpec(static::class, $field, DataObjectSchema::DB_ONLY);
        return !empty($spec);
    }
38904
protected function confirmValidate($value, $field)
    {
        return isset($this->data[$field]) && $this->data[$field] === $value;
    }
1078758
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case SUCCESS:
      return isSetSuccess();
    case CURRENT_VALUES:
      return isSetCurrent_values();
    }
    throw new IllegalStateException();
  }
1006891
public function fieldValue(EntityInterface $data, $field)
    {
        if (empty($data)) {
            $data = $this->getContext();
        }

        return $data->get($field);
    }
777472
protected function isFieldChanged($sField)
    {
        if (empty($sField)) {
            return false;
        }

        if ($this->obElement->$sField == $this->obElement->getOriginal($sField)) {
            return false;
        }

        return true;
    }
223726
public function validator($field, array $data)
    {
        if (!isset($data[$field]) || $data[$field] === '') {
            return $this->message('{fieldName}不能为空！', [
                '{fieldName}' => $this->getName($field),
            ]);
        }

        return true;
    }
721320
protected function updateByEntity($data, $entity)
	{
		return $this->aggregate[$entity->getType(true)]->update($data, $entity);
	}
998517
public function checkExistsAndInsertOrUpdateData($dataInsert = [], $dataUpdate = [], $wheres = [])
    {
        $this->connection();
        $db = DB::table($this->table);
        if (is_array($wheres) && count($wheres) > 0) {
            foreach ($wheres as $field => $value) {
                if (is_array($value)) {
                    $db->whereIn($field, $value);
                } else {
                    $db->where($field, self::OPERATOR_EQUAL_TO, $value);
                }
            }
        } else {
            $db->where($this->primaryKey, self::OPERATOR_EQUAL_TO, $wheres);
        }
        $checkExists = $db->count();
        $this->debug->debug(__FUNCTION__, 'Check Exists Data: ' . $checkExists);
        if (!$checkExists) {
            $id = $db->insertGetId($dataInsert);
            $this->debug->debug(__FUNCTION__, 'SQL Queries: ' . $db->toSql());
            $this->debug->debug(__FUNCTION__, 'Result Insert ID: ' . $id);

            return $id;
        } else {
            $resultId = $db->update($dataUpdate);
            $this->debug->debug(__FUNCTION__, 'Result Update Rows: ' . $resultId);

            return $resultId;
        }
    }
982438
public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case TIMESTAMP:
      return isSetTimestamp();
    case KEYS:
      return isSetKeys();
    case VALUES:
      return isSetValues();
    }
    throw new IllegalStateException();
  }
374529
public function update(array $data, $field, $id)
    {
        $this->applyCriteria();

        /** @var Model $model */
        $model = $this->model->where($field, $id)->first();

        $model->fill($data)->save();

        return $model;
    }
967400
protected function isSent($data = null)
  {
    if (!is_null($data)) {
      return true;
    }

    if ($name = $this->getName()) {
      return (bool)$this->getRequest()->get($name);
    }

    foreach ($this->fields as $n => $f) {
      if ($this->checkRequestHasValue($n)) {
        return true;
      }
    }

    return false;
  }