Sim
Well-known member
In one of my addons I am sending data to an external system by generating a Job with an array of data which can be sent asynchronously (and retried if sending fails!).
The array data contains phrases, which causes problems when the Job Manager attempts to serialize the data.
It would be useful if it could do the same thing when serializing the data - implement the Serializable interface which also simply calls
I don't really want to be passing json encoded data to the Job since there is a process later on which does the json encoding for me - it expects me to pass in an array of data.
The array data contains phrases, which causes problems when the Job Manager attempts to serialize the data.
\XF\Phrase
already implements \JsonSerializable
so that when rendering JSON, it automatically calls __toString()
on itself.It would be useful if it could do the same thing when serializing the data - implement the Serializable interface which also simply calls
__toString()
on itself. I'm assuming that unserialize wouldn't need to do anything, since we are not trying to reconstitute the original Phrase object.I don't really want to be passing json encoded data to the Job since there is a process later on which does the json encoding for me - it expects me to pass in an array of data.
Upvote
1