protected function _updateFields($data, $schema, $context) {
		$fields = [];
		$increment = [];

		if ($entity = $context->entity()) {
			$export = $entity->export();
			$increment = $export['increment'];

			array_map(function($key) use (&$data, $export){
				if (!empty($data[$key]) && $export['data'][$key] === $data[$key]) {
					unset($data[$key]);
				}
			}, array_keys($export['data']));

			if (!$data) {
				return null;
			}
		}

		foreach ($data as $field => $value) {
			$schema += [$field => ['default' => null]];
			$name = $this->name($field);

			if (isset($increment[$field])) {
				$fields[] = $name . ' = ' . $name . ' + ' . $this->value($increment[$field], $schema[$field]);
			} else {
				$fields[] = $name . ' = ' . $this->value($value, $schema[$field]);
			}
		}
		return join(', ', $fields);
	}
protected function _updateFields($data, $schema, $context) {
		$fields = [];
		$increment = [];

		if ($entity = $context->entity()) {
			$export = $entity->export();
			$increment = $export['increment'];

			array_map(function($key) use (&$data, $export){
				if (!empty($data[$key]) && $export['data'][$key] === $data[$key]) {
					unset($data[$key]);
				}
			}, array_keys($export['data']));

			if (!$data) {
				return null;
			}
		}

		foreach ($data as $field => $value) {
			$schema += [$field => ['default' => null]];
			$name = $this->name($field);

			if (isset($increment[$field])) {
				$fields[] = $name . ' = ' . $name . ' + ' . $this->value($increment[$field], $schema[$field]);
			} else {
				$fields[] = $name . ' = ' . $this->value($value, $schema[$field]);
			}
		}
		return join(', ', $fields);
	}
protected function _updateFields ( $ data , $ schema , $ context ) { $ fields = [ ] ; $ increment = [ ] ; if ( $ entity = $ context -> entity ( ) ) { $ export = $ entity -> export ( ) ; $ increment = $ export [ 'increment' ] ; array_map ( function ( $ key ) use ( & $ data , $ export ) { if ( ! empty ( $ data [ $ key ] ) && $ export [ 'data' ] [ $ key ] === $ data [ $ key ] ) { unset ( $ data [ $ key ] ) ; } } , array_keys ( $ export [ 'data' ] ) ) ; if ( ! $ data ) { return null ; } } foreach ( $ data as $ field => $ value ) { $ schema += [ $ field => [ 'default' => null ] ] ; $ name = $ this -> name ( $ field ) ; if ( isset ( $ increment [ $ field ] ) ) { $ fields [ ] = $ name . ' = ' . $ name . ' + ' . $ this -> value ( $ increment [ $ field ] , $ schema [ $ field ] ) ; } else { $ fields [ ] = $ name . ' = ' . $ this -> value ( $ value , $ schema [ $ field ] ) ; } } return join ( ', ' , $ fields ) ; }
Renders the fields part for _update_ queries.

Will only include fields if they have been updated in the entity of the context. Also
handles correct incremented/decremented fields.

@see lithium\data\Entity::increment()
@see lithium\data\source\Database::_fieldsReturn()
@param array $data
@param array $schema An array defining the schema of the fields used in the criteria.
@param object $context Generally a `data\model\Query` instance.
@return string|null SQL fragment, with fields separated by comma. Null when the fields
haven't been changed.
Renders the fields part for _update_ queries .