Skip to content
This repository has been archived by the owner on Jul 22, 2022. It is now read-only.

Doctrine problem #14

Closed
Nico24 opened this issue Dec 11, 2013 · 8 comments
Closed

Doctrine problem #14

Nico24 opened this issue Dec 11, 2013 · 8 comments

Comments

@Nico24
Copy link

Nico24 commented Dec 11, 2013

Now, I have this error after implement my application entities and update my config file following your different configurations for each bundles.

Unrecognized options "builder, factory, loader, class, basket, shipping, pa
yment" under "doctrine"

Do you have any idea what is wrong ?

@Bladrak
Copy link
Contributor

Bladrak commented Dec 12, 2013

Could you add your config? There's probably an issue with that. Thanks.

@Nico24
Copy link
Author

Nico24 commented Dec 12, 2013

I tried with your quick-started conf and also with the configuration for each application entities. The problem is always the same.

Find under my conf for the quick-started way :

config.yml


imports:
    - { resource: parameters.yml }
    - { resource: security.yml }
    - { resource: plus/hwio.yml }
    - { resource: sonata/sonata_block.yml }
    - { resource: sonata/sonata_media.yml }
    - { resource: sonata/sonata_admin.yml }
    - { resource: sonata/sonata_core.yml }
    - { resource: sonata/sonata_seo.yml }
    - { resource: sonata/sonata_notification.yml }
    - { resource: sonata/sonata_formatter.yml }
    - { resource: sonata/sonata_intl.yml }
    - { resource: sonata/sonata_news.yml }
    - { resource: sonata/sonata_ecommerce.yml }

framework:
    #esi:             ~
    translator:      { fallback: %locale% }
    secret:          %secret%
    router:
        resource: "%kernel.root_dir%/config/routing.yml"
        strict_requirements: ~
    form:            ~
    csrf_protection: ~
    validation:      { enable_annotations: true }
    templating:
        engines: ['twig']
        #assets_version: SomeVersionScheme
    default_locale:  "%locale%"
    trusted_proxies: ~
    session:         ~
    fragments:       ~
    http_method_override: true

twig:
    debug:            %kernel.debug%
    strict_variables: %kernel.debug%

assetic:
    debug:          %kernel.debug%
    use_controller: false
    bundles:        [ ]
    #java: /usr/bin/java
    filters:
        cssrewrite: ~
        #closure:
        #    jar: %kernel.root_dir%/Resources/java/compiler.jar
        #yui_css:
        #    jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar

doctrine:
    dbal:
        driver:   %database_driver%
        host:     %database_host%
        port:     %database_port%
        dbname:   %database_name%
        user:     %database_user%
        password: %database_password%
        charset:  UTF8
        # if using pdo_sqlite as your database driver, add the path in parameters.yml
        # e.g. database_path: %kernel.root_dir%/data/data.db3
        # path:     %database_path%
        types:
            json: Sonata\Doctrine\Types\JsonType
    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true

swiftmailer:
    transport: %mailer_transport%
    host:      %mailer_host%
    username:  %mailer_user%
    password:  %mailer_password%
    spool:     { type: memory }

gregwar_captcha: ~

mopa_bootstrap:
    form:
        show_legend: false 
        show_child_legend: false 

services:
    sonata.registration.form.type:
        class: Application\Sonata\UserBundle\Form\RegistrationType
        arguments: [%fos_user.model.user.class%]
        tags:
            - { name: form.type, alias: sonata_user_registration }

fos_user:
    db_driver: orm 
    firewall_name: main
    user_class: Application\Sonata\UserBundle\Entity\User
    service:
        mailer: fos_user.mailer.twig_swift
    registration:
        form:
            type: sonata_user_registration
        confirmation:
            enabled:    true
            from_email:
                address:        noreply@xxxx
                sender_name:    xxxx
    resetting:
        email:
            from_email:
                address:        noreply@xxxx
                sender_name:  xxxx

And for my ecommerce config, I simply copied your quick-started configuration without any changes.

@Bladrak
Copy link
Contributor

Bladrak commented Dec 12, 2013

Where did you get the quick started configuration from? (If you could provide a link, so we're sure we're speaking of the same thing. Thanks.)

@Nico24
Copy link
Author

Nico24 commented Dec 12, 2013

@Bladrak
Copy link
Contributor

Bladrak commented Dec 12, 2013

Hmm not sure if that's it but you're missing one element of config in your doctrine section:

# Doctrine Configuration
doctrine:
    dbal:
        types:
            currency: Sonata\Component\Currency\CurrencyDoctrineType

I'll update the documentation accordingly.

But even though that will be necessary at some point, I don't think your issue lays there. Do you have any occurrence of either builder, factory, loader, class, basket, shipping or payment in your overall config? I can't find it either in your config.yml or the documentation.

@Nico24
Copy link
Author

Nico24 commented Dec 16, 2013

Sorry for my late answer.
You're right, I forgot to put in my omr config the different occurrences.

But I still have an error to update my schema :


[Doctrine\ORM\Mapping\MappingException]
Entity 'Application\Sonata\ProductBundle\Entity\Product' has to be part of
the discriminator map of 'Application\Sonata\ProductBundle\Entity\Product'
to be properly mapped in the inheritance hierachy. Alternatively you can ma
ke 'Application\Sonata\ProductBundle\Entity\Product' an abstract class to a
void this exception from occurring.

I am still using your quick install tutorial : http://sonata-project.org/bundles/ecommerce/master/doc/reference/installation.html#quick-install

Thanks for your help.

@Bladrak
Copy link
Contributor

Bladrak commented Dec 17, 2013

You need to define your product classe(s) first.

@Bladrak
Copy link
Contributor

Bladrak commented Dec 23, 2013

I'm closing the issue, assuming you solved it. Feel free to re-open it if that's not the case!

@Bladrak Bladrak closed this as completed Dec 23, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants