src/View/ActionHandler/AbstractPropertyVisibilityHandler.php
protected function ensurePropertyVisibleInModel(
        Action $action,
        $propertyName,
        ModelInterface $model,
        EnvironmentInterface $environment
    ) {
        $palettesDefinition = $environment->getDataDefinition()->getPalettesDefinition();
        $propertyValues     = $this->getPropertyValueBagFromModel($action, $model, $environment);
        $palette            = $palettesDefinition->findPalette($model, $propertyValues);

        $invisible = false;
        foreach ($palette->getLegends() as $legend) {
            if ($invisible) {
                break;
            }

            foreach ($legend->getProperties($model, $propertyValues) as $property) {
                if ($invisible) {
                    break;
                }

                if ($property->getName() !== $propertyName) {
                    continue;
                }

                $invisible = $property->getVisibleCondition()->match($model, $propertyValues, $property, $legend);
            }
        }

        $findProperty =
            $environment->getDataDefinition()->getPropertiesDefinition()->getProperty($propertyName);

        return $this->matchVisibilityOfPropertyInAnyPalette($action, $findProperty, $invisible, $environment);
    }
protected function ensurePropertyVisibleInModel(
        Action $action,
        $propertyName,
        ModelInterface $model,
        EnvironmentInterface $environment
    ) {
        $palettesDefinition = $environment->getDataDefinition()->getPalettesDefinition();
        $propertyValues     = $this->getPropertyValueBagFromModel($action, $model, $environment);
        $palette            = $palettesDefinition->findPalette($model, $propertyValues);

        $invisible = false;
        foreach ($palette->getLegends() as $legend) {
            if ($invisible) {
                break;
            }

            foreach ($legend->getProperties($model, $propertyValues) as $property) {
                if ($invisible) {
                    break;
                }

                if ($property->getName() !== $propertyName) {
                    continue;
                }

                $invisible = $property->getVisibleCondition()->match($model, $propertyValues, $property, $legend);
            }
        }

        $findProperty =
            $environment->getDataDefinition()->getPropertiesDefinition()->getProperty($propertyName);

        return $this->matchVisibilityOfPropertyInAnyPalette($action, $findProperty, $invisible, $environment);
    }
protected function ensurePropertyVisibleInModel ( Action $ action , $ propertyName , ModelInterface $ model , EnvironmentInterface $ environment ) { $ palettesDefinition = $ environment -> getDataDefinition ( ) -> getPalettesDefinition ( ) ; $ propertyValues = $ this -> getPropertyValueBagFromModel ( $ action , $ model , $ environment ) ; $ palette = $ palettesDefinition -> findPalette ( $ model , $ propertyValues ) ; $ invisible = false ; foreach ( $ palette -> getLegends ( ) as $ legend ) { if ( $ invisible ) { break ; } foreach ( $ legend -> getProperties ( $ model , $ propertyValues ) as $ property ) { if ( $ invisible ) { break ; } if ( $ property -> getName ( ) !== $ propertyName ) { continue ; } $ invisible = $ property -> getVisibleCondition ( ) -> match ( $ model , $ propertyValues , $ property , $ legend ) ; } } $ findProperty = $ environment -> getDataDefinition ( ) -> getPropertiesDefinition ( ) -> getProperty ( $ propertyName ) ; return $ this -> matchVisibilityOfPropertyInAnyPalette ( $ action , $ findProperty , $ invisible , $ environment ) ; }
Ensure if the property is visible by the model.

@param Action               $action       The action.
@param string               $propertyName The property name.
@param ModelInterface       $model        The model.
@param EnvironmentInterface $environment  The environment.

@return bool
Ensure if the property is visible by the model .