3

I dont know what else to try, this seems like it should be so straight forward, but the Symfony profiler continues to show this error: enter image description here

Here are my User and Venue classes:

User:

namespace Application\Sonata\UserBundle\Entity;

use Sonata\UserBundle\Entity\BaseUser as BaseUser;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;


/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 */
class User extends BaseUser
{

    /**
     * @ORM\OneToMany(targetEntity="AppBundle\Entity\Venue",    mappedBy="user")
     */
     protected $venues;

    public function __construct()
    {
        parent::__construct();
        $this->venues = new ArrayCollection();
    }

}

Venue:

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Venue
 *
 * @ORM\Table()
 * @ORM\Entity
 */
class Venue
{
    /**
     * @ORM\ManyToOne(targetEntity="Application\Sonata\UserBundle\Entity\User", inversedBy="venues")
     * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
     */
    protected $user;

It seems to work fine in the application, I only get the error inside the Symfony Profiler. It keeps telling me venues doesnt exist on User but Im looking right at it! What am I not doing correctly here?

Zac Ball
  • 198
  • 8
  • 2
    Are you sure you have mapped your user entity using annotations ? by default sonata uses xml format for mapping, check doctrine folder under resources folder of your application user bundle – M Khalid Junaid Sep 21 '15 at 12:28
  • Yes, this was the issue. I was under the impression if I just added annotations they'd just work. :) I removed the xml config files completely and the annotations now wok without conflict. Thank you for your response. – Zac Ball Sep 22 '15 at 06:54

0 Answers0