2017-09-25 56 views
1

定制模式失败我想自定义Sylius类群的实体,这个文件如下:http://docs.sylius.org/en/latest/customization/model.htmlSylius:对分类群

在开发环境,没有任何问题,一切工作按计划进行。 但是当我切换到PROD环境中,我得到如下:

[Symfony\Component\Debug\Exception\FatalErrorException] 
Compile Error: require(): Failed opening required '/var/www/webshop/var/cache/prod/doctrine/orm/Proxies/__CG__SyliusComponentCoreModelTaxon.php' 

似乎被覆盖的类仍然被人需要的,但我想不出如何解决这个问题。我不明白为什么行为是不同的开发和生产...

也许我失去了一些东西?

感谢您的任何帮助。

回答

1

我回答我自己的问题:...问题是在我的身边......(经常:-))

我已经在这个项目上也覆盖了Channel实体,并有Channel.orm.yml文件它存储与Taxon实体的关系。

必须修改此文件,以便targetEntity(即覆盖的)实体,而不是来自Sylius核心的实体。

(AppBundle/Resources/config/doctrine/Channel.orm.yml) 
... 
targetEntity: AppBundle\Entity\Taxon 
... 

,而不是

(AppBundle/Resources/config/doctrine/Channel.orm.yml) 
... 
targetEntity: Sylius\Component\Core\Model\Taxon 
... 
0

尝试运行php bin/console cache:clear -e prod。它应该用新配置刷新var/cache目录。

+0

你应该[编辑]你的答案来形容这样做,为什么它可能会解决这个问题。 – Kenster

+0

这显然是我的第一次尝试:-)但是即使ca:cl在产品环境上也失败了 – Sylvain