protected function getSerializationContext(View $view)
    {
        $context = $view->getContext();

        $groups = $context->getGroups();
        if (empty($groups) && $this->exclusionStrategyGroups) {
            $context->setGroups($this->exclusionStrategyGroups);
        }

        if (null === $context->getVersion() && $this->exclusionStrategyVersion) {
            $context->setVersion($this->exclusionStrategyVersion);
        }

        if (null === $context->getSerializeNull() && null !== $this->serializeNullStrategy) {
            $context->setSerializeNull($this->serializeNullStrategy);
        }

        return $context;
    }
protected function getSerializationContext(View $view)
    {
        $context = $view->getContext();

        $groups = $context->getGroups();
        if (empty($groups) && $this->exclusionStrategyGroups) {
            $context->setGroups($this->exclusionStrategyGroups);
        }

        if (null === $context->getVersion() && $this->exclusionStrategyVersion) {
            $context->setVersion($this->exclusionStrategyVersion);
        }

        if (null === $context->getSerializeNull() && null !== $this->serializeNullStrategy) {
            $context->setSerializeNull($this->serializeNullStrategy);
        }

        return $context;
    }
protected function getSerializationContext ( View $ view ) { $ context = $ view -> getContext ( ) ; $ groups = $ context -> getGroups ( ) ; if ( empty ( $ groups ) && $ this -> exclusionStrategyGroups ) { $ context -> setGroups ( $ this -> exclusionStrategyGroups ) ; } if ( null === $ context -> getVersion ( ) && $ this -> exclusionStrategyVersion ) { $ context -> setVersion ( $ this -> exclusionStrategyVersion ) ; } if ( null === $ context -> getSerializeNull ( ) && null !== $ this -> serializeNullStrategy ) { $ context -> setSerializeNull ( $ this -> serializeNullStrategy ) ; } return $ context ; }
Gets or creates a JMS\Serializer\SerializationContext and initializes it with
the view exclusion strategies, groups & versions if a new context is created.

@param View $view

@return Context
Gets or creates a JMS \ Serializer \ SerializationContext and initializes it with the view exclusion strategies groups & versions if a new context is created .