gpt4 book ai didi

symfony - Doctrine2 [语义错误] 找不到常量?

转载 作者:行者123 更新时间:2023-12-02 07:20:19 26 4
gpt4 key购买 nike

尝试运行 doctrine:generate:entities 时出现错误:

[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] Couldn't find constant ?, property Smartnode\TalkBundle\Entity\Post::$postowner.

这是我的帖子实体类:

namespace Smartnode\TalkBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* Post
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="Smartnode\TalkBundle\Entity\PostRepository")
*/
class Post
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;

/**
* @var integer
*
* @ORM\ManyToOne(targetEntity=“Smartnode\userBundle\Entity\User“)
* @JoinColumn(name="postowner_id", referencedColumnName="id")
*/
protected $postowner;

/**
* @var integer
*
* @ORM\ManyTonOne(targetEntity=“Smartnode\TalkBundle\Entity\Chan“)
*/
private $postchan;

/**
* @var \DateTime
*
* @ORM\Column(name="creationdate", type="datetime")
*/
private $creationdate;

这是我的 User 实体类:

namespace Smartnode\userBundle\Entity;

use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;



/**
* @ORM\Entity(repositoryClass="Smartnode\userBundle\Entity\UserRepository")
* @ORM\Table(name="fos_user")
*/
class User extends BaseUser
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;

最佳答案

问题是引用:/

有了好的报价,一切都在工作感谢大家的帮助

关于symfony - Doctrine2 [语义错误] 找不到常量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22345029/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com