Symfony 无法从命令从存储库获取对象
我想更新表注释中的一些行 我会编写这个命令并尝试运行它,但出现了错误Symfony 无法从命令从存储库获取对象,symfony,doctrine,entity,Symfony,Doctrine,Entity,我想更新表注释中的一些行 我会编写这个命令并尝试运行它,但出现了错误 Fatal error: Class 'Blogger\BlogBundle\Repository\BlogRepository' not found in C:\Users\.. ..\vendor\doctrine\orm\lib\Doctrine\ORM\Repository\DefaultRepositoryFactory.php on line 75 如何修复它?如何从表中获取实体 UPD:My***捆绑包:评论
Fatal error: Class 'Blogger\BlogBundle\Repository\BlogRepository' not found in C:\Users\.. ..\vendor\doctrine\orm\lib\Doctrine\ORM\Repository\DefaultRepositoryFactory.php on line 75
如何修复它?如何从表中获取实体
UPD:My***捆绑包:评论
namespace pv\***Bundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Comments
*/
class Comments
{
/**
* @var integer
*/
private $id;
/**
* @var \DateTime
*/
private $date;
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $comment;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set date
*
* @param \DateTime $date
* @return Comments
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}
/**
* Get date
*
* @return \DateTime
*/
public function getDate()
{
return $this->date;
}
/**
* Set name
*
* @param string $name
* @return Comments
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set name
*
* @param string $name
* @return Comments
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Set comment
*
* @param string $comment
* @return Comments
*/
public function setComment($comment)
{
$this->comment = $comment;
return $this;
}
/**
* Get comment
*
* @return string
*/
public function getComment()
{
return $this->comment;
}
}
你能展示你的***Bundle:Comments实体吗?看起来你在博客实体中添加了一个存储库属性,但没有创建实际的存储库类。或者可能存储库位置错误或名称空间输入错误。@dmnptr我想更新问题。您的代码中有提到Blogger\BlogBundle\repository\BlogRepository吗?@dmnptr我的粗心让我见鬼去吧!我只是忘了从配置中删除这一行。非常感谢你!
namespace pv\***Bundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Comments
*/
class Comments
{
/**
* @var integer
*/
private $id;
/**
* @var \DateTime
*/
private $date;
/**
* @var string
*/
private $name;
/**
* @var string
*/
private $comment;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set date
*
* @param \DateTime $date
* @return Comments
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}
/**
* Get date
*
* @return \DateTime
*/
public function getDate()
{
return $this->date;
}
/**
* Set name
*
* @param string $name
* @return Comments
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set name
*
* @param string $name
* @return Comments
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Set comment
*
* @param string $comment
* @return Comments
*/
public function setComment($comment)
{
$this->comment = $comment;
return $this;
}
/**
* Get comment
*
* @return string
*/
public function getComment()
{
return $this->comment;
}
}