由于我是 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)