public function generateFormFields() : array {
		$result = [
			'success' => false,
			'error' => [],
			'data' => []
		];
		// details
		$details = [];
		if (!empty($this->collection['details'])) {
			$this->disassembleCollectionObject($this->collection['details'], $details);
		}
		// step 1: fields
		foreach ($this->fields as $k => $v) {
			if (!$this->skipExportField($k, $v)) continue;
			// if we have detail
			if (!empty($details[$k])) {
				$result['data'][$k . '[' . $v['options']['multiple_column'] . ']'] = [
					'name' => $v['options']['label_name'],
					'type' => $this->determineFieldType($v['options']['multiple_column'], $v)
				];
				continue;
			}
			// regular field
			$result['data'][$k] = [
				'name' => $v['options']['label_name'],
				'type' => $this->determineFieldType($k, $v)
			];
		}
		// step 2: detail fields
		foreach ($this->detail_fields as $k => $v) {
			foreach ($v['elements'] as $k2 => $v2) {
				if (!$this->skipExportField($k2, $v2)) continue;
				$result['data'][$k . '[' . $k2 . ']'] = [
					'name' => (isset($details[$k]['name']) ? ($details[$k]['name'] . ' - ') : '') . $v2['options']['label_name'],
					'type' => $this->determineFieldType($k2, $v2)
				];
			}
		}
		$result['success'] = true;
		return $result;
	}
public function generateFormFields() : array {
		$result = [
			'success' => false,
			'error' => [],
			'data' => []
		];
		// details
		$details = [];
		if (!empty($this->collection['details'])) {
			$this->disassembleCollectionObject($this->collection['details'], $details);
		}
		// step 1: fields
		foreach ($this->fields as $k => $v) {
			if (!$this->skipExportField($k, $v)) continue;
			// if we have detail
			if (!empty($details[$k])) {
				$result['data'][$k . '[' . $v['options']['multiple_column'] . ']'] = [
					'name' => $v['options']['label_name'],
					'type' => $this->determineFieldType($v['options']['multiple_column'], $v)
				];
				continue;
			}
			// regular field
			$result['data'][$k] = [
				'name' => $v['options']['label_name'],
				'type' => $this->determineFieldType($k, $v)
			];
		}
		// step 2: detail fields
		foreach ($this->detail_fields as $k => $v) {
			foreach ($v['elements'] as $k2 => $v2) {
				if (!$this->skipExportField($k2, $v2)) continue;
				$result['data'][$k . '[' . $k2 . ']'] = [
					'name' => (isset($details[$k]['name']) ? ($details[$k]['name'] . ' - ') : '') . $v2['options']['label_name'],
					'type' => $this->determineFieldType($k2, $v2)
				];
			}
		}
		$result['success'] = true;
		return $result;
	}
public function generateFormFields ( ) : array { $ result = [ 'success' => false , 'error' => [ ] , 'data' => [ ] ] ; // details $ details = [ ] ; if ( ! empty ( $ this -> collection [ 'details' ] ) ) { $ this -> disassembleCollectionObject ( $ this -> collection [ 'details' ] , $ details ) ; } // step 1: fields foreach ( $ this -> fields as $ k => $ v ) { if ( ! $ this -> skipExportField ( $ k , $ v ) ) continue ; // if we have detail if ( ! empty ( $ details [ $ k ] ) ) { $ result [ 'data' ] [ $ k . '[' . $ v [ 'options' ] [ 'multiple_column' ] . ']' ] = [ 'name' => $ v [ 'options' ] [ 'label_name' ] , 'type' => $ this -> determineFieldType ( $ v [ 'options' ] [ 'multiple_column' ] , $ v ) ] ; continue ; } // regular field $ result [ 'data' ] [ $ k ] = [ 'name' => $ v [ 'options' ] [ 'label_name' ] , 'type' => $ this -> determineFieldType ( $ k , $ v ) ] ; } // step 2: detail fields foreach ( $ this -> detail_fields as $ k => $ v ) { foreach ( $ v [ 'elements' ] as $ k2 => $ v2 ) { if ( ! $ this -> skipExportField ( $ k2 , $ v2 ) ) continue ; $ result [ 'data' ] [ $ k . '[' . $ k2 . ']' ] = [ 'name' => ( isset ( $ details [ $ k ] [ 'name' ] ) ? ( $ details [ $ k ] [ 'name' ] . ' - ' ) : '' ) . $ v2 [ 'options' ] [ 'label_name' ] , 'type' => $ this -> determineFieldType ( $ k2 , $ v2 ) ] ; } } $ result [ 'success' ] = true ; return $ result ; }
Generate form fields

@return array
Generate form fields