小编pra*_*iri的帖子

Symfony2:错误“属性已经声明,但只能声明一次”

由于我是 Symfony 的新手,我尝试使用 Doctrine 创建实体关系。当我尝试更新架构时,我收到错误“[bundle/entity/file_location”中的属性“report”已声明,但必须仅声明一次”

我遵循了 Symfony 文档,但找不到解决方案。

实体/报告.php

<?php

namespace Aurora\ReportBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * Report
 */
class Report
{
    /**
     * @var integer
     */
    private $id;
/**
 * @var string
 */
private $name;

/**
 * @var string
 */
private $description;

/**
 * var array
 */
private $reportFiles;


public function _construct() {
    $this->reportFiles = new ArrayCollection();
}
/**
 * Get id
 *
 * @return integer 
 */
public function getId()
{
    return $this->id;
} …
Run Code Online (Sandbox Code Playgroud)

entity-relationship doctrine symfony

2
推荐指数
1
解决办法
7130
查看次数

标签 统计

doctrine ×1

entity-relationship ×1

symfony ×1