Add change.

@param string $field
@param mixed  $value
@param int    $type

@return Changes
559459
public function addChange(
        string $field,
        $value,
        int $type = self::TYPE_VALUE
    ): self {
        $this->changes[] = [
            'field' => $field,
            'type' => $type,
            'value' => $value,
        ];

        return $this;
    }
510945
public static function typeCast($value, $type) {
		switch ($type) {
			case 'int':
				$value = (int)$value;
				break;
			case 'float':
				$value = (float)$value;
				break;
			case 'double':
				$value = (double)$value;
				break;
			case 'array':
				$value = (array)$value;
				break;
			case 'bool':
				$value = (bool)$value;
				break;
			case 'string':
				$value = (string)$value;
				break;
			default:
				return null;
		}
		return $value;
	}
491334
def append(self, value):
        ''''''
        if self.__dict__['values']:
            self.__dict__['changetype'] = MODIFY_REPLACE

        self.__dict__['values'].append(value)
393402
public function addField(string $field, string $value): self
    {
        $this->fields[$field] = $value;

        return $this;
    }
310599
public void put(Field field, Class<?> arrayComponentType, Object value) {
    ArrayValueMap.ArrayValue arrayValue = fieldMap.get(field);
    if (arrayValue == null) {
      arrayValue = new ArrayValue(arrayComponentType);
      fieldMap.put(field, arrayValue);
    }
    arrayValue.addValue(arrayComponentType, value);
  }
620711
public function getNewValue(string $field)
    {
        $change = $this->objectChangeSet->getFieldChange($field);

        if ($change !== null) {
            return $change->getNewValue();
        }
    }
243096
public function setNewValue($field, $value)
    {
        $this->assertValidField($field);

        $this->entityChangeSet[$field][1] = $value;
    }
662575
public function bindValue($param, $value, $type = \PDO::PARAM_STR)
    {
        $this->statement->bindValue($param, $value, $type);
        return $this;
    }
392894
public void addField(String name, Object value, Object type) {
        if (value == null) {
            this.fields.add(new Field(name, null, null));
        } else {
            this.fields.add(new Field(name, value.toString(), type.toString()));
        }
    }
715373
public function addContent($type, $value = null)
    {
        if ($type instanceof Content) {
            $content = $type;
        } else {
            $content = new Content($type, $value);
        }
        $this->contents[] = $content;
    }
730906
public function addBinding($value, $type = 'where') {
        if (! array_key_exists($type, $this->bindings)) {
            throw new InvalidArgumentException(
                __('Invalid binding type: ').$type
            );
        }

        if (is_array($value)) {
            $this->bindings[$type] = array_values(array_merge($this->bindings[$type], $value));
        } else {
            $this->bindings[$type][] = $value;
        }

        return $this;
    }
588788
public static function typeToggle($value, array $params, array $field)
    {
        if (\is_bool($value)) {
            $value = (int)$value;
        }

        return self::typeArray((array) $value, $params, $field);
    }
830482
public function add(string $type, string $value): void
    {
        if ($this->entry[$type] === null) {
            $this->entry[$type] = array();
        }
        $this->entry[$type] = (array) $this->entry[$type];
        $this->entry[$type][] = $value;
    }
452346
public function set($field, $value, $type = 0)
    {
        $this->_write_fields[] = $field;
        $this->_write_values[] = $value;
        $this->_write_field_types[] = $type;

        return $this;
    }
837459
public function increment(string $field, $value)
    {
        $this->update();
        $this->mongoDbUpdate['$inc'][$field] = $value;

        return $this;
    }
268148
public function stringLike($field, $value, $type = FilterOperands::STRING_CONTAINS)
    {
        $value = $this->convertTypeToMask($value, $type);

        return $this->expr()->like(
            $this->forceCaseInsensitivity ? $this->expr()->lower($field) : $field,
            $this->expr()->literal($value)
        );
    }
514301
public function set(string $field, $value)
    {
        $this->update();
        $this->mongoDbUpdate['$set'][$field] = $value;

        return $this;
    }