public function getFiltersParams(BuildWidgetEvent $event)
    {
        if (!$this->scopeMatcher->currentScopeIsBackend()) {
            return;
        }

        if (($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel_attribute')
            || ($event->getProperty()->getName() !== 'select_filterparams')
        ) {
            return;
        }

        $model      = $event->getModel();
        $properties = $event->getProperty();
        $arrExtra   = $properties->getExtra();
        $filterId   = $model->getProperty('select_filter');

        // Check if we have a filter, if not return.
        if (empty($filterId)) {
            return;
        }

        // Get the filter with the given id and check if we got it.
        // If not return.
        $filterSettings = $this->filterSettingFactory->createCollection($filterId);
        if ($filterSettings == null) {
            return;
        }

        // Set the subfields.
        $arrExtra['subfields'] = $filterSettings->getParameterDCA();
        $properties->setExtra($arrExtra);
    }
public function getFiltersParams(BuildWidgetEvent $event)
    {
        if (!$this->scopeMatcher->currentScopeIsBackend()) {
            return;
        }

        if (($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel_attribute')
            || ($event->getProperty()->getName() !== 'select_filterparams')
        ) {
            return;
        }

        $model      = $event->getModel();
        $properties = $event->getProperty();
        $arrExtra   = $properties->getExtra();
        $filterId   = $model->getProperty('select_filter');

        // Check if we have a filter, if not return.
        if (empty($filterId)) {
            return;
        }

        // Get the filter with the given id and check if we got it.
        // If not return.
        $filterSettings = $this->filterSettingFactory->createCollection($filterId);
        if ($filterSettings == null) {
            return;
        }

        // Set the subfields.
        $arrExtra['subfields'] = $filterSettings->getParameterDCA();
        $properties->setExtra($arrExtra);
    }
public function getFiltersParams ( BuildWidgetEvent $ event ) { if ( ! $ this -> scopeMatcher -> currentScopeIsBackend ( ) ) { return ; } if ( ( $ event -> getEnvironment ( ) -> getDataDefinition ( ) -> getName ( ) !== 'tl_metamodel_attribute' ) || ( $ event -> getProperty ( ) -> getName ( ) !== 'select_filterparams' ) ) { return ; } $ model = $ event -> getModel ( ) ; $ properties = $ event -> getProperty ( ) ; $ arrExtra = $ properties -> getExtra ( ) ; $ filterId = $ model -> getProperty ( 'select_filter' ) ; // Check if we have a filter, if not return. if ( empty ( $ filterId ) ) { return ; } // Get the filter with the given id and check if we got it. // If not return. $ filterSettings = $ this -> filterSettingFactory -> createCollection ( $ filterId ) ; if ( $ filterSettings == null ) { return ; } // Set the subfields. $ arrExtra [ 'subfields' ] = $ filterSettings -> getParameterDCA ( ) ; $ properties -> setExtra ( $ arrExtra ) ; }
Set the sub fields for the sub-dca based in the mm_filter selection.

@param BuildWidgetEvent $event The event.

@return void
Set the sub fields for the sub - dca based in the mm_filter selection .