Reputation: 116
I am trying to develop a Symfony2 API using the FOSRestBundle but I am stuck with an error regarding the serialization of one of my Doctrine entity (I'm using the JMS Serializer bundle for serialization).
The error message is the following : "Resources are not supported in serialized data"
The serialization worked until I made my entity implement a custom interface :
/**
* Quotation
*
* @ORM\Table(name="quotation")
* @ORM\Entity
*/
class Quotation implements FileStorageInterface
{
// content
}
And the interface :
interface FileStorageInterface
{
public function getFile();
public function setFile($file);
}
I searched online but couldn't find anything about serializing an entity implementing an interface. So if anyone has an idea on how to solve this, I would gladly accept it.
Upvotes: 0
Views: 1271
Reputation: 6012
The problem is not specifically because you are implementing just any interface, but because the object's data contains a resource. Having a look at the interface in question, I suspect dat setFile() is being called with a resource as value and stored on a property of the object.
Upvotes: 1