application/Espo/Core/Utils/Metadata/Helper.php
public function getAdditionalFieldList($fieldName, array $fieldParams, array $definitionList)
    {
        if (empty($fieldParams['type']) || empty($definitionList)) {
            return;
        }

        $fieldType = $fieldParams['type'];
        $fieldDefinition = isset($definitionList[$fieldType]) ? $definitionList[$fieldType] : null;

        if (isset($fieldDefinition) && !empty($fieldDefinition['fields']) && is_array($fieldDefinition['fields'])) {

            $copiedParams = array_intersect_key($fieldParams, array_flip($this->copiedDefParams));

            $additionalFields = array();

            //add additional fields
            foreach ($fieldDefinition['fields'] as $subFieldName => $subFieldParams) {
                $namingType = isset($fieldDefinition['naming']) ? $fieldDefinition['naming'] : $this->defaultNaming;

                $subFieldNaming = Util::getNaming($fieldName, $subFieldName, $namingType);
                $additionalFields[$subFieldNaming] = array_merge($copiedParams, $subFieldParams);
            }

            return $additionalFields;
        }

    }
public function getAdditionalFieldList($fieldName, array $fieldParams, array $definitionList)
    {
        if (empty($fieldParams['type']) || empty($definitionList)) {
            return;
        }

        $fieldType = $fieldParams['type'];
        $fieldDefinition = isset($definitionList[$fieldType]) ? $definitionList[$fieldType] : null;

        if (isset($fieldDefinition) && !empty($fieldDefinition['fields']) && is_array($fieldDefinition['fields'])) {

            $copiedParams = array_intersect_key($fieldParams, array_flip($this->copiedDefParams));

            $additionalFields = array();

            //add additional fields
            foreach ($fieldDefinition['fields'] as $subFieldName => $subFieldParams) {
                $namingType = isset($fieldDefinition['naming']) ? $fieldDefinition['naming'] : $this->defaultNaming;

                $subFieldNaming = Util::getNaming($fieldName, $subFieldName, $namingType);
                $additionalFields[$subFieldNaming] = array_merge($copiedParams, $subFieldParams);
            }

            return $additionalFields;
        }

    }
public function getAdditionalFieldList ( $ fieldName , array $ fieldParams , array $ definitionList ) { if ( empty ( $ fieldParams [ 'type' ] ) || empty ( $ definitionList ) ) { return ; } $ fieldType = $ fieldParams [ 'type' ] ; $ fieldDefinition = isset ( $ definitionList [ $ fieldType ] ) ? $ definitionList [ $ fieldType ] : null ; if ( isset ( $ fieldDefinition ) && ! empty ( $ fieldDefinition [ 'fields' ] ) && is_array ( $ fieldDefinition [ 'fields' ] ) ) { $ copiedParams = array_intersect_key ( $ fieldParams , array_flip ( $ this -> copiedDefParams ) ) ; $ additionalFields = array ( ) ; //add additional fields foreach ( $ fieldDefinition [ 'fields' ] as $ subFieldName => $ subFieldParams ) { $ namingType = isset ( $ fieldDefinition [ 'naming' ] ) ? $ fieldDefinition [ 'naming' ] : $ this -> defaultNaming ; $ subFieldNaming = Util :: getNaming ( $ fieldName , $ subFieldName , $ namingType ) ; $ additionalFields [ $ subFieldNaming ] = array_merge ( $ copiedParams , $ subFieldParams ) ; } return $ additionalFields ; } }
Get additional field list based on field definition in metadata 'fields'

@param  string     $fieldName
@param  array     $fieldParams
@param  array|null $definitionList

@return array
Get additional field list based on field definition in metadata fields