实体\识别
/**
* @ORM\Entity
* @ORM\Table(name="c_rcgntn")
*/
class Recognition {
/**
* @ORM\Id
* @ORM\Column(type="integer", name="id")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\RecognitionType", inversedBy="id")
* @ORM\JoinColumn(name="fk_recogtype_id", referencedColumnName="id")
*/
protected $recogType;
实体\识别类型
/**
* @ORM\Entity
* @ORM\Table(name="c_rcgntn_type")
*/
class RecognitionType {
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Recognition",mappedBy="recogType")
*/
protected $id;
在我的开发环境中运行它时,我看到错误出现在我的分析器中。这不是一个大问题,因为代码仍在运行并正确返回连接。我只是无法摆脱错误。
关联Entity\Recognition#recogType 是指未定义为关联的逆侧字段Entity\RecognitionType#id。关联Entity\Recognition#recogType是指不存在的反边字段Entity\RecognitionType#id。