src/Contao/View/Contao2BackendView/FileSelect.php
private function prepareValuesForFileSelector($propertyName, ModelIdInterface $modelId, DcCompat $combat)
    {
        $inputProvider = $this->itemContainer->getEnvironment()->getInputProvider();

        $fileSelectorValues = [];
        foreach (\array_filter(\explode(',', $inputProvider->getParameter('value'))) as $k => $v) {
            // Can be a UUID or a path
            if (Validator::isStringUuid($v)) {
                $fileSelectorValues[$k] = StringUtil::uuidToBin($v);
            }
        }

        if (\is_array($GLOBALS['TL_DCA'][$modelId->getDataProviderName()]['fields'][$propertyName]['load_callback'])) {
            $callbacks = $GLOBALS['TL_DCA'][$modelId->getDataProviderName()]['fields'][$propertyName]['load_callback'];
            foreach ($callbacks as $callback) {
                if (\is_array($callback)) {
                    $fileSelectorValues =
                        Callbacks::callArgs($callback, [$fileSelectorValues, $combat]);
                } elseif (\is_callable($callback)) {
                    $fileSelectorValues = $callback($fileSelectorValues, $combat);
                }
            }
        }

        return $fileSelectorValues;
    }
private function prepareValuesForFileSelector($propertyName, ModelIdInterface $modelId, DcCompat $combat)
    {
        $inputProvider = $this->itemContainer->getEnvironment()->getInputProvider();

        $fileSelectorValues = [];
        foreach (\array_filter(\explode(',', $inputProvider->getParameter('value'))) as $k => $v) {
            // Can be a UUID or a path
            if (Validator::isStringUuid($v)) {
                $fileSelectorValues[$k] = StringUtil::uuidToBin($v);
            }
        }

        if (\is_array($GLOBALS['TL_DCA'][$modelId->getDataProviderName()]['fields'][$propertyName]['load_callback'])) {
            $callbacks = $GLOBALS['TL_DCA'][$modelId->getDataProviderName()]['fields'][$propertyName]['load_callback'];
            foreach ($callbacks as $callback) {
                if (\is_array($callback)) {
                    $fileSelectorValues =
                        Callbacks::callArgs($callback, [$fileSelectorValues, $combat]);
                } elseif (\is_callable($callback)) {
                    $fileSelectorValues = $callback($fileSelectorValues, $combat);
                }
            }
        }

        return $fileSelectorValues;
    }
private function prepareValuesForFileSelector ( $ propertyName , ModelIdInterface $ modelId , DcCompat $ combat ) { $ inputProvider = $ this -> itemContainer -> getEnvironment ( ) -> getInputProvider ( ) ; $ fileSelectorValues = [ ] ; foreach ( \ array_filter ( \ explode ( ',' , $ inputProvider -> getParameter ( 'value' ) ) ) as $ k => $ v ) { // Can be a UUID or a path if ( Validator :: isStringUuid ( $ v ) ) { $ fileSelectorValues [ $ k ] = StringUtil :: uuidToBin ( $ v ) ; } } if ( \ is_array ( $ GLOBALS [ 'TL_DCA' ] [ $ modelId -> getDataProviderName ( ) ] [ 'fields' ] [ $ propertyName ] [ 'load_callback' ] ) ) { $ callbacks = $ GLOBALS [ 'TL_DCA' ] [ $ modelId -> getDataProviderName ( ) ] [ 'fields' ] [ $ propertyName ] [ 'load_callback' ] ; foreach ( $ callbacks as $ callback ) { if ( \ is_array ( $ callback ) ) { $ fileSelectorValues = Callbacks :: callArgs ( $ callback , [ $ fileSelectorValues , $ combat ] ) ; } elseif ( \ is_callable ( $ callback ) ) { $ fileSelectorValues = $ callback ( $ fileSelectorValues , $ combat ) ; } } } return $ fileSelectorValues ; }
Prepare the values for the file selector.

@param string           $propertyName The property name.
@param ModelIdInterface $modelId      The model identifier.
@param DcCompat         $combat       The data container compatibility.

@return array

@SuppressWarnings(PHPMD.Superglobals)
Prepare the values for the file selector .