public function sortFieldsForProcessing($fields, $options = []) {
		if (!empty($this->collection_object)) {
			$collection = array_key_get($this->collection_object->data, $options['details_collection_key'] ?? null);
			foreach ($fields as $k => $v) {
				// skip certain values
				if ($k == $this::SEPARATOR_HORIZONTAL || $k == $this::SEPARATOR_VERTICAL || !empty($v['options']['process_submit']) || !empty($v['options']['custom_renderer'])) {
					unset($fields[$k]);
					continue;
				}
				// sort
				if (isset($fields[$k]['options']['order_for_defaults'])) {
					$fields[$k]['order_for_defaults'] = $fields[$k]['options']['order_for_defaults'];
				} else if (in_array($k, $collection['pk'] ?? [])) {
					$fields[$k]['order_for_defaults'] = -32000;
				} else if (!empty($v['options']['default']) && strpos($v['options']['default'], 'dependent::') !== false) { // processed last
					$fields[$k]['order_for_defaults'] = 2147483647 - 32000 + intval(str_replace(['dependent::', 'static::'], '', $v['options']['default']));
				} else if (!empty($v['options']['default']) && (strpos($v['options']['default'], 'parent::') !== false || strpos($v['options']['default'], 'static::') !== false)) {
					$column = str_replace(['parent::', 'static::'], '', $v['options']['default']);
					$fields[$k]['order_for_defaults'] = ($fields[$column]['order_for_defaults'] ?? 0) + 100;
				} else if (!isset($fields[$k]['order_for_defaults'])) {
					$fields[$k]['order_for_defaults'] = (($this->data[$fields[$k]['options']['container_link']]['order'] ?? 1000) * 10000) + ($fields[$k]['row_order'] * 100) + $fields[$k]['order'];
				}
			}
			array_key_sort($fields, ['order_for_defaults' => SORT_ASC], ['order_for_defaults' => SORT_NUMERIC]);
		}
		return $fields;
	}
public function sortFieldsForProcessing($fields, $options = []) {
		if (!empty($this->collection_object)) {
			$collection = array_key_get($this->collection_object->data, $options['details_collection_key'] ?? null);
			foreach ($fields as $k => $v) {
				// skip certain values
				if ($k == $this::SEPARATOR_HORIZONTAL || $k == $this::SEPARATOR_VERTICAL || !empty($v['options']['process_submit']) || !empty($v['options']['custom_renderer'])) {
					unset($fields[$k]);
					continue;
				}
				// sort
				if (isset($fields[$k]['options']['order_for_defaults'])) {
					$fields[$k]['order_for_defaults'] = $fields[$k]['options']['order_for_defaults'];
				} else if (in_array($k, $collection['pk'] ?? [])) {
					$fields[$k]['order_for_defaults'] = -32000;
				} else if (!empty($v['options']['default']) && strpos($v['options']['default'], 'dependent::') !== false) { // processed last
					$fields[$k]['order_for_defaults'] = 2147483647 - 32000 + intval(str_replace(['dependent::', 'static::'], '', $v['options']['default']));
				} else if (!empty($v['options']['default']) && (strpos($v['options']['default'], 'parent::') !== false || strpos($v['options']['default'], 'static::') !== false)) {
					$column = str_replace(['parent::', 'static::'], '', $v['options']['default']);
					$fields[$k]['order_for_defaults'] = ($fields[$column]['order_for_defaults'] ?? 0) + 100;
				} else if (!isset($fields[$k]['order_for_defaults'])) {
					$fields[$k]['order_for_defaults'] = (($this->data[$fields[$k]['options']['container_link']]['order'] ?? 1000) * 10000) + ($fields[$k]['row_order'] * 100) + $fields[$k]['order'];
				}
			}
			array_key_sort($fields, ['order_for_defaults' => SORT_ASC], ['order_for_defaults' => SORT_NUMERIC]);
		}
		return $fields;
	}
public function sortFieldsForProcessing ( $ fields , $ options = [ ] ) { if ( ! empty ( $ this -> collection_object ) ) { $ collection = array_key_get ( $ this -> collection_object -> data , $ options [ 'details_collection_key' ] ?? null ) ; foreach ( $ fields as $ k => $ v ) { // skip certain values if ( $ k == $ this :: SEPARATOR_HORIZONTAL || $ k == $ this :: SEPARATOR_VERTICAL || ! empty ( $ v [ 'options' ] [ 'process_submit' ] ) || ! empty ( $ v [ 'options' ] [ 'custom_renderer' ] ) ) { unset ( $ fields [ $ k ] ) ; continue ; } // sort if ( isset ( $ fields [ $ k ] [ 'options' ] [ 'order_for_defaults' ] ) ) { $ fields [ $ k ] [ 'order_for_defaults' ] = $ fields [ $ k ] [ 'options' ] [ 'order_for_defaults' ] ; } else if ( in_array ( $ k , $ collection [ 'pk' ] ?? [ ] ) ) { $ fields [ $ k ] [ 'order_for_defaults' ] = - 32000 ; } else if ( ! empty ( $ v [ 'options' ] [ 'default' ] ) && strpos ( $ v [ 'options' ] [ 'default' ] , 'dependent::' ) !== false ) { // processed last $ fields [ $ k ] [ 'order_for_defaults' ] = 2147483647 - 32000 + intval ( str_replace ( [ 'dependent::' , 'static::' ] , '' , $ v [ 'options' ] [ 'default' ] ) ) ; } else if ( ! empty ( $ v [ 'options' ] [ 'default' ] ) && ( strpos ( $ v [ 'options' ] [ 'default' ] , 'parent::' ) !== false || strpos ( $ v [ 'options' ] [ 'default' ] , 'static::' ) !== false ) ) { $ column = str_replace ( [ 'parent::' , 'static::' ] , '' , $ v [ 'options' ] [ 'default' ] ) ; $ fields [ $ k ] [ 'order_for_defaults' ] = ( $ fields [ $ column ] [ 'order_for_defaults' ] ?? 0 ) + 100 ; } else if ( ! isset ( $ fields [ $ k ] [ 'order_for_defaults' ] ) ) { $ fields [ $ k ] [ 'order_for_defaults' ] = ( ( $ this -> data [ $ fields [ $ k ] [ 'options' ] [ 'container_link' ] ] [ 'order' ] ?? 1000 ) * 10000 ) + ( $ fields [ $ k ] [ 'row_order' ] * 100 ) + $ fields [ $ k ] [ 'order' ] ; } } array_key_sort ( $ fields , [ 'order_for_defaults' => SORT_ASC ] , [ 'order_for_defaults' => SORT_NUMERIC ] ) ; } return $ fields ; }
Sort fields for processing

@param array $fields
@return int
Sort fields for processing