protected function getIntersectionModel(Action $action, EnvironmentInterface $environment)
    {
        $inputProvider        = $environment->getInputProvider();
        $dataProvider         = $environment->getDataProvider();
        $dataDefinition       = $environment->getDataDefinition();
        $propertiesDefinition = $dataDefinition->getPropertiesDefinition();
        $session              = $this->getSession($action, $environment);

        $intersectModel = $dataProvider->getEmptyModel();

        $defaultPalette      = null;
        $legendPropertyNames = $this->getLegendPropertyNames($intersectModel, $environment, $defaultPalette);

        $idProperty = \method_exists($dataProvider, 'getIdProperty') ? $dataProvider->getIdProperty() : 'id';
        foreach ((array) $session['intersectValues'] as $intersectProperty => $intersectValue) {
            if (($idProperty === $intersectProperty)
                || !$propertiesDefinition->hasProperty($intersectProperty)
                || (false === $this->useIntersectValue(
                    $intersectProperty,
                    $legendPropertyNames,
                    $environment,
                    $defaultPalette
                ))
            ) {
                continue;
            }

            if ($inputProvider->hasValue($intersectProperty)) {
                $intersectModel->setProperty($intersectProperty, $inputProvider->getValue($intersectProperty));

                continue;
            }

            $intersectModel->setProperty($intersectProperty, $intersectValue);
        }

        $this->intersectModelSetPrimaryId($action, $intersectModel, $idProperty, $environment);
        $this->intersectModelSetParentId($intersectModel, $environment);

        return $intersectModel;
    }