src/Controller/Ajax3X.php
private function getFieldName()
    {
        $environment   = $this->getEnvironment();
        $inputProvider = $environment->getInputProvider();

        $fieldName = $inputProvider->hasValue('name') ? $inputProvider->getValue('name') : null;
        if (null === $fieldName) {
            return $fieldName;
        }

        if (('select' !== $inputProvider->getParameter('act'))
            && ('edit' !== $inputProvider->getParameter('mode'))
        ) {
            return $fieldName;
        }

        $dataDefinition = $environment->getDataDefinition();
        $sessionStorage = $environment->getSessionStorage();

        $session = $sessionStorage->get($dataDefinition->getName() . '.' . $inputProvider->getParameter('select'));

        $originalPropertyName = null;
        foreach ($session['models'] as $modelId) {
            if (null !== $originalPropertyName) {
                break;
            }

            $propertyNamePrefix = \str_replace('::', '____', $modelId) . '_';
            if (0 !== strpos($fieldName, $propertyNamePrefix)) {
                continue;
            }

            $originalPropertyName = \substr($fieldName, \strlen($propertyNamePrefix));
        }

        if (!$originalPropertyName) {
            return $fieldName;
        }

        return $originalPropertyName;
    }
private function getFieldName()
    {
        $environment   = $this->getEnvironment();
        $inputProvider = $environment->getInputProvider();

        $fieldName = $inputProvider->hasValue('name') ? $inputProvider->getValue('name') : null;
        if (null === $fieldName) {
            return $fieldName;
        }

        if (('select' !== $inputProvider->getParameter('act'))
            && ('edit' !== $inputProvider->getParameter('mode'))
        ) {
            return $fieldName;
        }

        $dataDefinition = $environment->getDataDefinition();
        $sessionStorage = $environment->getSessionStorage();

        $session = $sessionStorage->get($dataDefinition->getName() . '.' . $inputProvider->getParameter('select'));

        $originalPropertyName = null;
        foreach ($session['models'] as $modelId) {
            if (null !== $originalPropertyName) {
                break;
            }

            $propertyNamePrefix = \str_replace('::', '____', $modelId) . '_';
            if (0 !== strpos($fieldName, $propertyNamePrefix)) {
                continue;
            }

            $originalPropertyName = \substr($fieldName, \strlen($propertyNamePrefix));
        }

        if (!$originalPropertyName) {
            return $fieldName;
        }

        return $originalPropertyName;
    }
private function getFieldName ( ) { $ environment = $ this -> getEnvironment ( ) ; $ inputProvider = $ environment -> getInputProvider ( ) ; $ fieldName = $ inputProvider -> hasValue ( 'name' ) ? $ inputProvider -> getValue ( 'name' ) : null ; if ( null === $ fieldName ) { return $ fieldName ; } if ( ( 'select' !== $ inputProvider -> getParameter ( 'act' ) ) && ( 'edit' !== $ inputProvider -> getParameter ( 'mode' ) ) ) { return $ fieldName ; } $ dataDefinition = $ environment -> getDataDefinition ( ) ; $ sessionStorage = $ environment -> getSessionStorage ( ) ; $ session = $ sessionStorage -> get ( $ dataDefinition -> getName ( ) . '.' . $ inputProvider -> getParameter ( 'select' ) ) ; $ originalPropertyName = null ; foreach ( $ session [ 'models' ] as $ modelId ) { if ( null !== $ originalPropertyName ) { break ; } $ propertyNamePrefix = \ str_replace ( '::' , '____' , $ modelId ) . '_' ; if ( 0 !== strpos ( $ fieldName , $ propertyNamePrefix ) ) { continue ; } $ originalPropertyName = \ substr ( $ fieldName , \ strlen ( $ propertyNamePrefix ) ) ; } if ( ! $ originalPropertyName ) { return $ fieldName ; } return $ originalPropertyName ; }
Get the field name.

@return null|string
Get the field name .