protected function prepareSaveData($fieldPrefix, $fieldsConfig)
	{
		foreach ($fieldsConfig as $fieldName => $fieldConfig) {

			if (isset($fieldConfig['inputType']) && $fieldConfig['inputType'] === 'list') {

				// creates an empty array for a empty lists
				$fieldData = $this->getNestedValueReference($fieldPrefix . $fieldName);

				for ($dataKey = 0; isset($fieldData[$dataKey]); $dataKey++) {
					$this->prepareSaveData($fieldPrefix . $fieldName . '__' . $dataKey . '__', $fieldConfig['fields']);
				}

			}

		}
	}
protected function prepareSaveData($fieldPrefix, $fieldsConfig)
	{
		foreach ($fieldsConfig as $fieldName => $fieldConfig) {

			if (isset($fieldConfig['inputType']) && $fieldConfig['inputType'] === 'list') {

				// creates an empty array for a empty lists
				$fieldData = $this->getNestedValueReference($fieldPrefix . $fieldName);

				for ($dataKey = 0; isset($fieldData[$dataKey]); $dataKey++) {
					$this->prepareSaveData($fieldPrefix . $fieldName . '__' . $dataKey . '__', $fieldConfig['fields']);
				}

			}

		}
	}
protected function prepareSaveData ( $ fieldPrefix , $ fieldsConfig ) { foreach ( $ fieldsConfig as $ fieldName => $ fieldConfig ) { if ( isset ( $ fieldConfig [ 'inputType' ] ) && $ fieldConfig [ 'inputType' ] === 'list' ) { // creates an empty array for a empty lists $ fieldData = $ this -> getNestedValueReference ( $ fieldPrefix . $ fieldName ) ; for ( $ dataKey = 0 ; isset ( $ fieldData [ $ dataKey ] ) ; $ dataKey ++ ) { $ this -> prepareSaveData ( $ fieldPrefix . $ fieldName . '__' . $ dataKey . '__' , $ fieldConfig [ 'fields' ] ) ; } } } }
prepare the data to save and create empty arrays for empty lists

@param  string $fieldPrefix  field prefix
@param  array  $fieldsConfig fields configuration
@return void
prepare the data to save and create empty arrays for empty lists