Sylius Inventory Bundle:“sylius_inventory.classes”

时间:2015-08-12 11:47:42

标签: symfony sylius

我正在尝试安装 Sylius Inventory Bundle ,但在更新架构时,我收到此错误: [Symfony \ Component \ Config \ Definition \ Exception \ InvalidConfigurationException]   “sylius_inventory.classes”

下无法识别的选项“unit”

我正在关注the documentation

InventoryUnit实体:

<?php

// src/App/AppBundle/Entity/InventoryUnit.php
namespace App\AppBundle\Entity;

use Sylius\Bundle\InventoryBundle\Entity\InventoryUnit as BaseInventoryUnit;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="app_inventory_unit")
 */
class InventoryUnit extends BaseInventoryUnit
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    protected $id;
}

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

配置应该是:

sylius_inventory:
    driver: doctrine/orm
    backorders: true
    classes:
        inventory_unit:
            model: App\AppBundle\Entity\InventoryUnit
        stockable:
            model: App\AppBundle\Entity\Book

Documentation需要update