【发布时间】:2015-11-11 03:35:16
【问题描述】:
我正在尝试使用 FOSRestBundle 开发 Symfony2 API,但我遇到了关于我的 Doctrine 实体之一的序列化错误(我正在使用 JMS Serializer 包进行序列化)。
错误信息如下:“序列化数据不支持资源”
序列化一直有效,直到我让我的实体实现了一个自定义接口:
/**
* Quotation
*
* @ORM\Table(name="quotation")
* @ORM\Entity
*/
class Quotation implements FileStorageInterface
{
// content
}
还有界面:
interface FileStorageInterface
{
public function getFile();
public function setFile($file);
}
我在网上搜索,但找不到任何关于序列化实现接口的实体的信息。所以如果有人知道如何解决这个问题,我很乐意接受。
【问题讨论】:
-
我是否理解正确:如果您在没有任何其他操作的情况下删除字符串
implements FileStorageInterface一切正常吗? -
就是这样!
标签: php symfony doctrine fosrestbundle jmsserializerbundle