src/View/ActionHandler/AbstractPropertyVisibilityHandler.php
private function analyzeExcludeProperty(
        Action $action,
        EnvironmentInterface $environment,
        PropertyInterface $property,
        PalettesDefinitionInterface $palettesDefinition
    ) {
        $defaultPalette    = $palettesDefinition->findPalette();
        $defaultProperties = $defaultPalette->getProperties();

        if (empty($defaultProperties)) {
            return false;
        }

        $emptyModel = $this->getIntersectionModel($action, $environment);

        $excludeProperty = false;
        foreach ($defaultProperties as $defaultProperty) {
            if ($property->getName() !== $defaultProperty->getName()) {
                continue;
            }

            $event = new GetPropertyOptionsEvent($environment, $emptyModel);
            $event->setPropertyName($property->getName());
            $event->setOptions($property->getOptions());
            $environment->getEventDispatcher()->dispatch(GetPropertyOptionsEvent::NAME, $event);
            if ((null === $event->getOptions()) || (0 > \count($event->getOptions()))) {
                continue;
            }

            $paletteCounter = 0;
            foreach (\array_keys($event->getOptions()) as $paletteName) {
                $palettesDefinition->hasPaletteByName($paletteName) ? ++$paletteCounter : null;
            }
            if ($paletteCounter !== \count($event->getOptions())) {
                continue;
            }

            $property->setOptions($event->getOptions());
            $excludeProperty = true;
        }

        return $excludeProperty;
    }
private function analyzeExcludeProperty(
        Action $action,
        EnvironmentInterface $environment,
        PropertyInterface $property,
        PalettesDefinitionInterface $palettesDefinition
    ) {
        $defaultPalette    = $palettesDefinition->findPalette();
        $defaultProperties = $defaultPalette->getProperties();

        if (empty($defaultProperties)) {
            return false;
        }

        $emptyModel = $this->getIntersectionModel($action, $environment);

        $excludeProperty = false;
        foreach ($defaultProperties as $defaultProperty) {
            if ($property->getName() !== $defaultProperty->getName()) {
                continue;
            }

            $event = new GetPropertyOptionsEvent($environment, $emptyModel);
            $event->setPropertyName($property->getName());
            $event->setOptions($property->getOptions());
            $environment->getEventDispatcher()->dispatch(GetPropertyOptionsEvent::NAME, $event);
            if ((null === $event->getOptions()) || (0 > \count($event->getOptions()))) {
                continue;
            }

            $paletteCounter = 0;
            foreach (\array_keys($event->getOptions()) as $paletteName) {
                $palettesDefinition->hasPaletteByName($paletteName) ? ++$paletteCounter : null;
            }
            if ($paletteCounter !== \count($event->getOptions())) {
                continue;
            }

            $property->setOptions($event->getOptions());
            $excludeProperty = true;
        }

        return $excludeProperty;
    }
private function analyzeExcludeProperty ( Action $ action , EnvironmentInterface $ environment , PropertyInterface $ property , PalettesDefinitionInterface $ palettesDefinition ) { $ defaultPalette = $ palettesDefinition -> findPalette ( ) ; $ defaultProperties = $ defaultPalette -> getProperties ( ) ; if ( empty ( $ defaultProperties ) ) { return false ; } $ emptyModel = $ this -> getIntersectionModel ( $ action , $ environment ) ; $ excludeProperty = false ; foreach ( $ defaultProperties as $ defaultProperty ) { if ( $ property -> getName ( ) !== $ defaultProperty -> getName ( ) ) { continue ; } $ event = new GetPropertyOptionsEvent ( $ environment , $ emptyModel ) ; $ event -> setPropertyName ( $ property -> getName ( ) ) ; $ event -> setOptions ( $ property -> getOptions ( ) ) ; $ environment -> getEventDispatcher ( ) -> dispatch ( GetPropertyOptionsEvent :: NAME , $ event ) ; if ( ( null === $ event -> getOptions ( ) ) || ( 0 > \ count ( $ event -> getOptions ( ) ) ) ) { continue ; } $ paletteCounter = 0 ; foreach ( \ array_keys ( $ event -> getOptions ( ) ) as $ paletteName ) { $ palettesDefinition -> hasPaletteByName ( $ paletteName ) ? ++ $ paletteCounter : null ; } if ( $ paletteCounter !== \ count ( $ event -> getOptions ( ) ) ) { continue ; } $ property -> setOptions ( $ event -> getOptions ( ) ) ; $ excludeProperty = true ; } return $ excludeProperty ; }
Analyze property for exclude.

@param Action                      $action             The action.
@param EnvironmentInterface        $environment        The environment.
@param PropertyInterface           $property           The property.
@param PalettesDefinitionInterface $palettesDefinition The palettes definition.

@return bool
Analyze property for exclude .