4
另一束
我想另一束「targetEntity」屬性使用一個實體,但它產生的錯誤...「targetEntity」從Symfony2.3
這個類之間:
namespace Tgb\CoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Website
*
* @ORM\Table(name="core_website")
* @ORM\Entity(repositoryClass="Tgb\CoreBundle\Entity\WebsiteRepository")
*/
class Website
{
/**
* @var Tgb\BlogBunble\Entity\Blog
*
* @ORM\OneToOne(targetEntity="Tgb\BlogBunble\Entity\Blog", mappedBy="website")
*/
private $blog;
而且這一個:
namespace Tgb\BlogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Blog
*
* @ORM\Table(name="blog")
* @ORM\Entity(repositoryClass="Tgb\BlogBundle\Entity\BlogRepository")
*/
class Blog
{
/**
* @var Tgb\CoreBunble\Entity\Website
*
* @ORM\OneToOne(targetEntity="Tgb\CoreBunble\Entity\Website", inversedBy="blog", cascade={"persist", "merge"})
*/
private $website;
當我運行行命令:
sf doctrine:schema:update --force
我得到:
[Doctrine\ORM\Mapping\MappingException]
The target-entity Tgb\BlogBunble\Entity\Blog cannot be found in 'Tgb\CoreBundle\Entity\Website#blog'.
有什麼建議?
確定只有兩個的第一個想法更換
BlogBunble
:有你清除了緩存?套件都在AppKernel中註冊? – stwe拼寫錯誤:BlogBunble - > BlogBundle – stwe
試試這個PHP應用程序/控制檯學說:映射:信息 如果你沒有找到找你捆綁你需要註冊在AppKernel –