src/Sulu/Bundle/AudienceTargetingBundle/Serializer/Subscriber/TargetGroupSerializeSubscriber.php
public function onPostDeserialize(ObjectEvent $event)
    {
        /** @var TargetGroupInterface $targetGroup */
        $targetGroup = $event->getObject();

        if (!$targetGroup instanceof TargetGroupInterface) {
            return;
        }

        /* @var TargetGroupWebspaceInterface $webspace */
        if ($targetGroup->getWebspaces()) {
            foreach ($targetGroup->getWebspaces() as $webspace) {
                $webspace->setTargetGroup($targetGroup);
            }
        }

        if ($targetGroup->getRules()) {
            foreach ($targetGroup->getRules() as $rule) {
                $rule->setTargetGroup($targetGroup);
            }
        }
    }
public function onPostDeserialize(ObjectEvent $event)
    {
        /** @var TargetGroupInterface $targetGroup */
        $targetGroup = $event->getObject();

        if (!$targetGroup instanceof TargetGroupInterface) {
            return;
        }

        /* @var TargetGroupWebspaceInterface $webspace */
        if ($targetGroup->getWebspaces()) {
            foreach ($targetGroup->getWebspaces() as $webspace) {
                $webspace->setTargetGroup($targetGroup);
            }
        }

        if ($targetGroup->getRules()) {
            foreach ($targetGroup->getRules() as $rule) {
                $rule->setTargetGroup($targetGroup);
            }
        }
    }
public function onPostDeserialize ( ObjectEvent $ event ) { /** @var TargetGroupInterface $targetGroup */ $ targetGroup = $ event -> getObject ( ) ; if ( ! $ targetGroup instanceof TargetGroupInterface ) { return ; } /* @var TargetGroupWebspaceInterface $webspace */ if ( $ targetGroup -> getWebspaces ( ) ) { foreach ( $ targetGroup -> getWebspaces ( ) as $ webspace ) { $ webspace -> setTargetGroup ( $ targetGroup ) ; } } if ( $ targetGroup -> getRules ( ) ) { foreach ( $ targetGroup -> getRules ( ) as $ rule ) { $ rule -> setTargetGroup ( $ targetGroup ) ; } } }
Called after a target group was deserialized.

@param ObjectEvent $event
Called after a target group was deserialized .