类sylius.model.product_archetype.class不存在。

时间:2016-08-07 21:14:16

标签: symfony sylius

我正在开发Symfony 2应用程序,在集成Sylius产品包的过程中,运行时出现以下错误

php app/console doctrine:schema:update --force

错误是

 The class sylius.model.product_archetype.class does not exist.  

配置 这是我的confi.yml文件

    sylius_cart:
    resolver: app.cart_item_resolver # The id of our newly created service.
    classes: ~ # This key can be empty but it must be present in the configuration.

sylius_order:
    driver: doctrine/orm # Configure the doctrine orm driver used in documentation.

sylius_money: ~

sylius_product:
    driver: doctrine/orm

stof_doctrine_extensions:
    orm:
        default:
            sluggable: true
            timestampable: true

#sylius_archetype:
sylius_archetype:
    driver: doctrine/orm # Configure the doctrine orm driver used in the documentation.

sylius_translation:
  default_locale: en

我所包含的捆绑包是 新的FOS \ RestBundle \ FOSRestBundle(),

   new JMS\SerializerBundle\JMSSerializerBundle($this),
    new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
    new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
    new Sylius\Bundle\ProductBundle\SyliusProductBundle(),
    new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
    new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
    new Sylius\Bundle\VariationBundle\SyliusVariationBundle(),
    new Sylius\Bundle\TranslationBundle\SyliusTranslationBundle(),
    new Sylius\Bundle\CartBundle\SyliusCartBundle(),
    new Sylius\Bundle\OrderBundle\SyliusOrderBundle(),
    new Sylius\Bundle\MoneyBundle\SyliusMoneyBundle(),
    new Sylius\Bundle\ArchetypeBundle\SyliusArchetypeBundle(),

知道我在这里做错了什么。似乎文档不再与代码匹配。

2 个答案:

答案 0 :(得分:0)

核心团队正在努力清理文档(see here),目标是1.0测试版。

您似乎需要Sylius的许多组件。那么从标准版开始创建自己的软件包来改变你想要的东西呢?自定义指南是最新的(here)。

答案 1 :(得分:0)

产品原型的核心配置参考如下:

sylius_archetype:
resources:
    product:
        archetype:
            classes:
                model: Sylius\Component\Core\Model\Archetype
                interface: Sylius\Component\Product\Model\ArchetypeInterface
            translation:
                classes:
                    model: Sylius\Component\Product\Model\ArchetypeTranslation
                    interface: Sylius\Component\Product\Model\ArchetypeTranslationInterface
        subject: Sylius\Component\Core\Model\Product
        attribute: Sylius\Component\Product\Model\Attribute
        option: Sylius\Component\Product\Model\Option

你必须改变,我想

Sylius\Component\Core\Model\Archetype

通过

Sylius\Component\Product\Model\Archetype

并且

Sylius\Component\Core\Model\Product

通过

Sylius\Component\Product\Model\Product

希望这会有所帮助:)