-1

I'm trying to customize the Product Model in Sylius based on this documentation page: Sylius Customization Guide: Customizing Models.

In AppBundle I created my own class Product:

namespace AppBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Product as BaseProduct;

/**
 * Class Product
 * @ORM\Entity
 * @ORM\Table(name="sylius_product")
 */
 class Product extends BaseProduct
 {
    ...
 }

But when I run

 $ php bin/console doctrine:schema:update --force

I get this error:

 [Doctrine\ORM\Mapping\MappingException]                                                                        
 Property "translations" in "AppBundle\Entity\Product" 
 was already declared, but it must be declared only once  

Any ideas? Thank you.

flame79
  • 67
  • 4

1 Answers1

1

you need to override config for your model. Add this to your configuratioN

sylius_product:
    resources:
        product:
            classes:
                model: AppBundle\Entity\Product
Antonio Peric
  • 246
  • 1
  • 2
  • 13