src/Contao/View/Contao2BackendView/BaseView.php
private function findOriginalPropertyByModelId($propertyName)
    {
        if (null === $propertyName) {
            return null;
        }

        $inputProvider  = $this->getEnvironment()->getInputProvider();
        $sessionStorage = $this->getEnvironment()->getSessionStorage();

        $selectAction = $inputProvider->getParameter('select');

        $session = $sessionStorage->get($this->getEnvironment()->getDataDefinition()->getName() . '.' . $selectAction);

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

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

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

        $propertiesDefinition = $this->getEnvironment()->getDataDefinition()->getPropertiesDefinition();
        if (!$propertiesDefinition->hasProperty($originalPropertyName)) {
            return null;
        }

        return $propertiesDefinition->getProperty($originalPropertyName);
    }
private function findOriginalPropertyByModelId($propertyName)
    {
        if (null === $propertyName) {
            return null;
        }

        $inputProvider  = $this->getEnvironment()->getInputProvider();
        $sessionStorage = $this->getEnvironment()->getSessionStorage();

        $selectAction = $inputProvider->getParameter('select');

        $session = $sessionStorage->get($this->getEnvironment()->getDataDefinition()->getName() . '.' . $selectAction);

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

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

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

        $propertiesDefinition = $this->getEnvironment()->getDataDefinition()->getPropertiesDefinition();
        if (!$propertiesDefinition->hasProperty($originalPropertyName)) {
            return null;
        }

        return $propertiesDefinition->getProperty($originalPropertyName);
    }
private function findOriginalPropertyByModelId ( $ propertyName ) { if ( null === $ propertyName ) { return null ; } $ inputProvider = $ this -> getEnvironment ( ) -> getInputProvider ( ) ; $ sessionStorage = $ this -> getEnvironment ( ) -> getSessionStorage ( ) ; $ selectAction = $ inputProvider -> getParameter ( 'select' ) ; $ session = $ sessionStorage -> get ( $ this -> getEnvironment ( ) -> getDataDefinition ( ) -> getName ( ) . '.' . $ selectAction ) ; $ originalPropertyName = null ; foreach ( $ session [ 'models' ] as $ modelId ) { if ( null !== $ originalPropertyName ) { break ; } $ propertyNamePrefix = \ str_replace ( '::' , '____' , $ modelId ) . '_' ; if ( 0 !== strpos ( $ propertyName , $ propertyNamePrefix ) ) { continue ; } $ originalPropertyName = \ substr ( $ propertyName , \ strlen ( $ propertyNamePrefix ) ) ; } $ propertiesDefinition = $ this -> getEnvironment ( ) -> getDataDefinition ( ) -> getPropertiesDefinition ( ) ; if ( ! $ propertiesDefinition -> hasProperty ( $ originalPropertyName ) ) { return null ; } return $ propertiesDefinition -> getProperty ( $ originalPropertyName ) ; }
Find the original property by the modelId.

@param string $propertyName The property name.

@return PropertyInterface|null
Find the original property by the modelId .