如何将 Zend+Doctrine2 从 Wamp 移植到 Mamp
我在我的 Windows 机器上有一个自己的小应用程序,我想在工作时将其放在我的 Mac 上。
两者都是php5.3.2(使用arraycache的教义)。在 Mac 上,我通过终端更新了架构,清除了缓存并重新生成了代理。
但是,它给了我这些错误通知:
Notice: Unknown: "id" returned as member variable from __sleep() but does not exist in Unknown on line 0
( ! ) Notice: Unknown: "created" returned as member variable from __sleep() but does not exist in Unknown on line 0
( ! ) Notice: Unknown: "modified" returned as member variable from __sleep() but does not exist in Unknown on line 0
( ! ) Notice: Unknown: "name" returned as member variable from __sleep() but does not exist in Unknown on line 0
在我看来,对于对象的每个成员都是如此。我发现这个睡眠通知非常陌生......任何关于为什么会发生这种情况的线索吗?
I have a little app for myself on my windows machine which i want to put on my mac at work.
Both are php5.3.2 (doctrine using arraycache). On the mac via terminal i updated the schema, cleared cache and regenerated proxies.
But, it gives me these error notices:
Notice: Unknown: "id" returned as member variable from __sleep() but does not exist in Unknown on line 0
( ! ) Notice: Unknown: "created" returned as member variable from __sleep() but does not exist in Unknown on line 0
( ! ) Notice: Unknown: "modified" returned as member variable from __sleep() but does not exist in Unknown on line 0
( ! ) Notice: Unknown: "name" returned as member variable from __sleep() but does not exist in Unknown on line 0
And so on for every member of the object in my view. I found this sleep notice very unfamiliar... any clue as to why this is happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的实体正在被序列化。如果您将其存储在会话中,则这种情况会透明地发生,否则它可能位于代码中的某个位置。请参阅有关 Doctrine 2 实体序列化和一些陷阱的文档:
http://www.doctrine-project .org/docs/orm/2.0/en/reference/architecture.html#serializing-entities
您需要发布一些代码来查看发生这种情况的位置或原因,但根本原因是序列化。
Your entity is being serialized. If you're storing it in session, this happens transparently, otherwise it could be somewhere in your code. See the documentation about serialization of Doctrine 2 entities, and some pitfalls:
http://www.doctrine-project.org/docs/orm/2.0/en/reference/architecture.html#serializing-entities
You'd need to post some code to see where, or why this is happening, but the underlying reason is the serialization.
检查实体类中的变量是否受保护且不是私有的
Checks if the variables are protected and not private in the entity class