Symfony2 实体属性将被忽略


Symfony2 entity attributes are ignored

我在Symfony2上遇到了一个奇怪的行为。

我有一个表示我的应用程序中的文档的实体。此实体链接到具有多对一关系的另外两个实体。
这是类:

实体''文档.php

namespace Acem'APPBundle'Entity;
use Doctrine'ORM'Mapping as ORM;
use Symfony'Component'Validator'Constraints as Assert;
/**
 * @ORM'Entity
 * @ORM'Table(name="documents")
 */
class Document
{
    /** 
     * @ORM'Id()
     * @ORM'ManyToOne(targetEntity="Resource", inversedBy="documents") 
     * @ORM'JoinColumn(name="resource_id", referencedColumnName="id", nullable=false) 
     */
    protected $resource;
    /** 
     * @ORM'Id()
     * @ORM'ManyToOne(targetEntity="User", inversedBy="documents") 
     * @ORM'JoinColumn(name="user_id", referencedColumnName="id", nullable=false) 
     */
    protected $owner;
    /**
     * ORM'Column(type="boolean")
     */
    protected $enabled;
    /**
     * ORM'Column(type="string")
     */
    protected $title;
    /**
     * ORM'Column(type="int")
     */
    protected $value;
}

我的问题是,教义只生成一个包含两列resource_iduser_id的表,而其他字段则完全被忽略。
当我使用 doctrine:generate:entities 时也会发生同样的事情,getter/setter 仅为具有 ManyToOne 关系的两个属性生成,而其他属性似乎不存在用于教义。

什么可能导致这种奇怪的行为以及如何解决它?

谢谢

为每个

字段引用添加一个@符号。那时看起来就像@ORM'Column...