application/Espo/Core/Utils/FieldManager.php
protected function normalizeDefs($scope, $fieldName, array $fieldDefs)
    {
        $defs = new \stdClass();

        $normalizedFieldDefs = $this->prepareFieldDefs($scope, $fieldName, $fieldDefs);

        if (!empty($normalizedFieldDefs)) {
            $defs->fields = (object) array(
                $fieldName => (object) $normalizedFieldDefs,
            );
        }

        /** Save links for a field. */
        $linkDefs = isset($fieldDefs['linkDefs']) ? $fieldDefs['linkDefs'] : null;
        $metaLinkDefs = $this->getMetadataHelper()->getLinkDefsInFieldMeta($scope, $fieldDefs);

        if (isset($linkDefs) || isset($metaLinkDefs)) {
            $metaLinkDefs = isset($metaLinkDefs) ? $metaLinkDefs : array();
            $linkDefs = isset($linkDefs) ? $linkDefs : array();

            $normalizedLinkdDefs = Util::merge($metaLinkDefs, $linkDefs);
            if (!empty($normalizedLinkdDefs)) {
                $defs->links = (object) array(
                    $fieldName => (object) $normalizedLinkdDefs,
                );
            }
        }

        return $defs;
    }
protected function normalizeDefs($scope, $fieldName, array $fieldDefs)
    {
        $defs = new \stdClass();

        $normalizedFieldDefs = $this->prepareFieldDefs($scope, $fieldName, $fieldDefs);

        if (!empty($normalizedFieldDefs)) {
            $defs->fields = (object) array(
                $fieldName => (object) $normalizedFieldDefs,
            );
        }

        /** Save links for a field. */
        $linkDefs = isset($fieldDefs['linkDefs']) ? $fieldDefs['linkDefs'] : null;
        $metaLinkDefs = $this->getMetadataHelper()->getLinkDefsInFieldMeta($scope, $fieldDefs);

        if (isset($linkDefs) || isset($metaLinkDefs)) {
            $metaLinkDefs = isset($metaLinkDefs) ? $metaLinkDefs : array();
            $linkDefs = isset($linkDefs) ? $linkDefs : array();

            $normalizedLinkdDefs = Util::merge($metaLinkDefs, $linkDefs);
            if (!empty($normalizedLinkdDefs)) {
                $defs->links = (object) array(
                    $fieldName => (object) $normalizedLinkdDefs,
                );
            }
        }

        return $defs;
    }
protected function normalizeDefs ( $ scope , $ fieldName , array $ fieldDefs ) { $ defs = new \ stdClass ( ) ; $ normalizedFieldDefs = $ this -> prepareFieldDefs ( $ scope , $ fieldName , $ fieldDefs ) ; if ( ! empty ( $ normalizedFieldDefs ) ) { $ defs -> fields = ( object ) array ( $ fieldName => ( object ) $ normalizedFieldDefs , ) ; } /** Save links for a field. */ $ linkDefs = isset ( $ fieldDefs [ 'linkDefs' ] ) ? $ fieldDefs [ 'linkDefs' ] : null ; $ metaLinkDefs = $ this -> getMetadataHelper ( ) -> getLinkDefsInFieldMeta ( $ scope , $ fieldDefs ) ; if ( isset ( $ linkDefs ) || isset ( $ metaLinkDefs ) ) { $ metaLinkDefs = isset ( $ metaLinkDefs ) ? $ metaLinkDefs : array ( ) ; $ linkDefs = isset ( $ linkDefs ) ? $ linkDefs : array ( ) ; $ normalizedLinkdDefs = Util :: merge ( $ metaLinkDefs , $ linkDefs ) ; if ( ! empty ( $ normalizedLinkdDefs ) ) { $ defs -> links = ( object ) array ( $ fieldName => ( object ) $ normalizedLinkdDefs , ) ; } } return $ defs ; }
Add all needed block for a field defenition

@param string $scope
@param string $fieldName
@param array $fieldDefs
@return array
Add all needed block for a field defenition