Doctrine 2.x和zend框架集成1.11 - 实体生成错误没有@ORM等

时间:2012-11-26 19:33:54

标签: zend-framework frameworks doctrine entity

我已将zend与教义相结合,一切正常但当我开始使用doctrine cli生成实体时:doctrine orm:generate-entities 我在评论中获得了没有@ORM,@ Entity的php Entities类。

示例:

<?php



use Doctrine\ORM\Mapping as ORM;

/**
 * Tag
 */
class Tag
{
    /**
     * @var string $tagName
     */
    private $tagName;

    /**
     * @var \Doctrine\Common\Collections\ArrayCollection
     */
    private $eventevent;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->eventevent = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get tagName
     *
     * @return string 
     */
    public function getTagName()
    {
        return $this->tagName;
    }

    /**
     * Add eventevent
     *
     * @param Event $eventevent
     * @return Tag
     */
    public function addEventevent(\Event $eventevent)
    {
        $this->eventevent[] = $eventevent;

        return $this;
    }

    /**
     * Remove eventevent
     *
     * @param Event $eventevent
     */
    public function removeEventevent(\Event $eventevent)
    {
        $this->eventevent->removeElement($eventevent);
    }

    /**
     * Get eventevent
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getEventevent()
    {
        return $this->eventevent;
    }
}

0 个答案:

没有答案