1
votes

when I serialize my object using jmsserializerbundle I get corrent JSON object but one property is empty (it's object type), the definition of this property looks like this:

/**
 * @var stdObject
 *
 * @ORM\Column(name="searchQueryParams", type="object")
 * @Expose
 * @Type("stdClass")
 */
private $searchQueryParams;

But even if there is an object on this entity the serializer outpus it like this:

{ "id": 10, "search_query_params": {}, "created": "2013-07-02T10:31:02+0200" },

Just an empty object, with is not true. This is value of searchQueryParams in DB:

O:8:"stdClass":2:{s:4:"name";s:8:"Greacja2";s:10:"price_from";s:4:"2000";}

2

2 Answers

0
votes

Its a well-known bug of jms serializer. You can store data in database as array and serialize later as array.

0
votes

Changing @Type to "Array" seemed to worked.