Symfony Ошибка сопоставления: «Ассоциация Entity \ Rule # ruleSettings ссылается на несущее поле Entity \ RuleSettings # rules, которое не существует». - PullRequest
0 голосов
/ 27 января 2020

Я бы спросил, почему я получаю ошибку

 [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

Есть мои сущности: Rule

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

RuleSettings

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

Какая у меня там проблема?

1 Ответ

0 голосов
/ 27 января 2020

mappedBy="rules" не равно $rule

изменить на mappedBy="rule"

...