0
votes

I'm trying to install Sylius Inventory Bundle but while updating schema, I get this error: [Symfony\Component\Config\Definition\Exception\InvalidConfigurationException] Unrecognized option "unit" under "sylius_inventory.classes"

I am following the documentation

InventoryUnit entity:

<?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;
}

Thanks for help!

1

1 Answers

0
votes

Configuration should be:

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

Documentation needs an update.