SonataUserBundle oneToMany Mapping Error

时间:2015-09-15 15:36:55

标签: symfony sonata-admin sonata-user-bundle

我不知道还有什么可以尝试,这似乎应该如此直接,但Symfony探查器继续显示此错误: enter image description here

以下是我的用户和地点课程:

用户:

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();
    }

}

地点:

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;

它似乎在应用程序中工作正常,我只在Symfony Profiler中得到错误。它一直告诉我用户不存在场地,但我正好看它!我在这里做得不好?

0 个答案:

没有答案