I am installing Sonata Ecommerce. After a lot of mistakes, I've had this one that I can not solve:
[Mapping] FAIL - The entity-class 'Application\Sonata\ProductBundle\Entity\ProductCollection' mapping is invalid:
* The association Application\Sonata\ProductBundle\Entity\ProductCollection#collection refers to the inverse side field Application\Sonata\ClassificationBundle\Entity\Collection#productCollection which does not exist.
Following the documentation in link , in the configuration from sonata_product I have:
sonata_product:
products:
# Prototype
app.product:
provider: app.product.type # Required
manager: app.product.manager # Required
variations:
fields: [] # Required
class:
product: Application\Sonata\ProductBundle\Entity\Product
package: Application\Sonata\ProductBundle\Entity\Package
product_category: Application\Sonata\ProductBundle\Entity\ProductCategory
product_collection: Application\Sonata\ProductBundle\Entity\ProductCollection
category: Application\Sonata\ClassificationBundle\Entity\Category
collection: Application\Sonata\ClassificationBundle\Entity\Collection
delivery: Application\Sonata\ProductBundle\Entity\Delivery
gallery: Application\Sonata\MediaBundle\Entity\Gallery
app.product
is a product that I created with the sonata:product:generate
command.
I understand that it is necessary to define in the entity ClassificationBundle:Collection
an inverse relation on ProductBundle:ProductCollection
. But I do not find in the documentation any example about what kind of relationship. I have tried many-to-one
and one-to-many
, but still giving me the same error ...