protected function _fieldsReturn($type, $context, $fields, $schema) {
		if ($type === 'create' || $type === 'update') {
			$data = $context->data();

			if (isset($data['data']) && is_array($data['data']) && count($data) === 1) {
				$data = $data['data'];
			}
			if ($fields && is_array($fields) && is_int(key($fields))) {
				$data = array_intersect_key($data, array_combine($fields, $fields));
			}
			$method = "_{$type}Fields";
			return $this->{$method}($data, $schema, $context);
		}
		return empty($fields) ? '*' : join(', ', $fields);
	}
protected function _fieldsReturn($type, $context, $fields, $schema) {
		if ($type === 'create' || $type === 'update') {
			$data = $context->data();

			if (isset($data['data']) && is_array($data['data']) && count($data) === 1) {
				$data = $data['data'];
			}
			if ($fields && is_array($fields) && is_int(key($fields))) {
				$data = array_intersect_key($data, array_combine($fields, $fields));
			}
			$method = "_{$type}Fields";
			return $this->{$method}($data, $schema, $context);
		}
		return empty($fields) ? '*' : join(', ', $fields);
	}
protected function _fieldsReturn ( $ type , $ context , $ fields , $ schema ) { if ( $ type === 'create' || $ type === 'update' ) { $ data = $ context -> data ( ) ; if ( isset ( $ data [ 'data' ] ) && is_array ( $ data [ 'data' ] ) && count ( $ data ) === 1 ) { $ data = $ data [ 'data' ] ; } if ( $ fields && is_array ( $ fields ) && is_int ( key ( $ fields ) ) ) { $ data = array_intersect_key ( $ data , array_combine ( $ fields , $ fields ) ) ; } $ method = "_{$type}Fields" ; return $ this -> { $ method } ( $ data , $ schema , $ context ) ; } return empty ( $ fields ) ? '*' : join ( ', ' , $ fields ) ; }
Renders the fields SQL fragment for queries.

@see lithium\data\source\Database::fields()
@param string $type Type of query i.e. `'create'` or `'update'`.
@param object $context Generally a `data\model\Query` instance.
@param array $fields
@param array $schema An array defining the schema of the fields used in the criteria.
@return string|array|null
Renders the fields SQL fragment for queries .