0

我会问为什么我会出错

 [FAIL] The entity-class AppBundle\Entity\Rule mapping is invalid:
 * The association AppBundle\Entity\Rule#ruleSettings refers to the owning side field AppBundle\Entity\RuleSettings#rules which does not exist.

 [FAIL] The entity-class AppBundle\Entity\RuleSettings mapping is invalid:
 * The association AppBundle\Entity\RuleSettings#targets refers to the inverse side field AppBundle\Entity\Target#rulesettings which does not exist.
 * The association AppBundle\Entity\RuleSettings#departments refers to the inverse side field AppBundle\Entity\Department#rulesettings which does not exist.
 * The association AppBundle\Entity\RuleSettings#ruleActions refers to the owning side field AppBundle\Entity\RuleAction#rulesettings which does not exist.

 ...

当我打电话时

console  doctrine:schema:validate

有我的实体:规则

 /**
     * @ORM\OneToMany(targetEntity="RuleSettings",mappedBy="rules")
     */
    private $ruleSettings;

规则设置

  /**
     * @ORM\ManyToOne(targetEntity="Rule")
     * @ORM\JoinColumn(name="ruleId",nullable=false)
     */
    private $rule;

我有什么问题?

4

1 回答 1

0

mappedBy="rules"不等于$rule

改成mappedBy="rule"

于 2020-01-27T08:29:06.110 回答