tchoulom / ViewCounterBundle

This bundle is used to count the number of views of a page.
MIT License
15 stars 11 forks source link

Error message in profiler #2

Closed jchesne closed 5 years ago

jchesne commented 5 years ago

Hi, I have this error on profiler: The field mybundle\Entity\myentity#viewCounters is on the inverse side of a bi-directional relationship, but the specified mappedBy association on the target-entity mybundle\Entity\ViewCounter#event does not contain the required 'inversedBy="viewCounters"' attribute. Do i missed something ?

tchoulom commented 5 years ago

Hi,

You must add inversedBy="viewCounters" in the ViewCounter class:

    /**
     * @ORM\ManyToOne(targetEntity="Article", cascade={"persist"}, inversedBy="viewCounters")
     * @ORM\JoinColumn(nullable=true)
     */
    private $article;

The documentation has been updated accordingly.

Thanks.