src/View/ActionHandler/AbstractPropertyVisibilityHandler.php
private function intersectModelSetParentId(ModelInterface $intersectModel, EnvironmentInterface $environment)
    {
        $dataDefinition       = $environment->getDataDefinition();
        $parentDataDefinition = $environment->getParentDataDefinition();

        if (null === $parentDataDefinition) {
            return;
        }

        $relationships  = $dataDefinition->getModelRelationshipDefinition();
        $childCondition =
            $relationships->getChildCondition($parentDataDefinition->getName(), $dataDefinition->getName());

        $parentField = null;
        foreach ($childCondition->getSetters() as $setter) {
            if (!\array_key_exists('to_field', $setter)) {
                continue;
            }

            $parentField = $setter['to_field'];
            break;
        }

        if (null !== $parentField) {
            $intersectModel->setProperty(
                $parentField,
                ModelId::fromSerialized($environment->getInputProvider()->getParameter('pid'))
                    ->getId()
            );
        }
    }
private function intersectModelSetParentId(ModelInterface $intersectModel, EnvironmentInterface $environment)
    {
        $dataDefinition       = $environment->getDataDefinition();
        $parentDataDefinition = $environment->getParentDataDefinition();

        if (null === $parentDataDefinition) {
            return;
        }

        $relationships  = $dataDefinition->getModelRelationshipDefinition();
        $childCondition =
            $relationships->getChildCondition($parentDataDefinition->getName(), $dataDefinition->getName());

        $parentField = null;
        foreach ($childCondition->getSetters() as $setter) {
            if (!\array_key_exists('to_field', $setter)) {
                continue;
            }

            $parentField = $setter['to_field'];
            break;
        }

        if (null !== $parentField) {
            $intersectModel->setProperty(
                $parentField,
                ModelId::fromSerialized($environment->getInputProvider()->getParameter('pid'))
                    ->getId()
            );
        }
    }
private function intersectModelSetParentId ( ModelInterface $ intersectModel , EnvironmentInterface $ environment ) { $ dataDefinition = $ environment -> getDataDefinition ( ) ; $ parentDataDefinition = $ environment -> getParentDataDefinition ( ) ; if ( null === $ parentDataDefinition ) { return ; } $ relationships = $ dataDefinition -> getModelRelationshipDefinition ( ) ; $ childCondition = $ relationships -> getChildCondition ( $ parentDataDefinition -> getName ( ) , $ dataDefinition -> getName ( ) ) ; $ parentField = null ; foreach ( $ childCondition -> getSetters ( ) as $ setter ) { if ( ! \ array_key_exists ( 'to_field' , $ setter ) ) { continue ; } $ parentField = $ setter [ 'to_field' ] ; break ; } if ( null !== $ parentField ) { $ intersectModel -> setProperty ( $ parentField , ModelId :: fromSerialized ( $ environment -> getInputProvider ( ) -> getParameter ( 'pid' ) ) -> getId ( ) ) ; } }
Set the parent id to the inersect model.

@param ModelInterface       $intersectModel The intersect model.
@param EnvironmentInterface $environment    The environment.

@return void
Set the parent id to the inersect model .