Symfony jms serializer enable when needed

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Symfony jms serializer enable when needed



I have jms serializer and in my class entity have annotation. I have case when I need apply jms serializer annotation only in some case. How to do this ? First I think need move annotation from entity class to uml maybe and create some handler where I can enable this annotation for this entity, in the rest of the time jms are not applicable to entity



my entity


/**
* @AnnotationExclusionPolicy("all")
*/
class Application implements ContainsRecordedMessages
{
/**
* @var int
*
* @AnnotationGroups({
* "get_application"
* })
* @AnnotationExpose()
*/
private $id;

/**
* @var int
*
* @AnnotationGroups({
* "post_application"
* })
* @AnnotationSerializedName("company_id")
* @AnnotationExpose()
*/
private $companyId;

/**
* @var string
*
* @AnnotationGroups({
* "post_application"
* })
* @AnnotationSerializedName("channel_sale")
* @AnnotationExpose()
*/
private $channelSale;



and I have class manager for this entity where I want enable jms and the disable jms serializer annotation


class ApplicationManager
{
public function someFunction()
{
$this->enableJmsForEntity(Application::class);
//some logic
//
$this->disableJmsForEntity(Application::class);
}
}









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived