0

我正在努力定义在这里找到的实体映射器: https ://github.com/Payum/PayumBundle/blob/master/Resources/doc/capture_funds_with_paypal_express_checkout.md#2-a-configure-doctrine-storage

    payum:
    contexts:
        your_context_name:
            doctrine_storage:
                driver: orm
                model_class: AcmeDemoBundle\Entity\PaypalPaymentInstruction

doctrine:
    orm:
        entity_managers:
            default:
                mappings: 
                    payum_paypal_express_checkout_nvp:                          
                        is_bundle: false
                        type: xml 
                        dir: %kernel.root_dir%/../vendor/payum/paypal-express-checkout-nvp/src/Payum/Paypal/ExpressCheckout/Nvp/Bridge/Doctrine/Resources/mapping
                        prefix: Payum\Paypal\ExpressCheckout\Nvp\Bridge\Doctrine\Entity

我目前的学说配置是自动加载为真。我的问题是让这个映射与我的自动加载一起工作:true

当我删除我的时,我可以让映射工作,autoload: true但任何提示将不胜感激,但问题是我如何从这个映射信息创建一个表?

4

1 回答 1

1

这个配置对我很有效。它添加了一个 id 字段(它来自捆绑并被自动映射),其余字段来自手动定义的映射。

我在沙箱中添加了一个示例。它工作正常。

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%

    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true

        mappings:
            payum_paypal_express_checkout_nvp:                          
                is_bundle: false
                type: xml 
                dir: %kernel.root_dir%/../vendor/payum/paypal-express-checkout-nvp/src/Payum/Paypal/ExpressCheckout/Nvp/Bridge/Doctrine/Resources/mapping
                prefix: Payum\Paypal\ExpressCheckout\Nvp\Bridge\Doctrine\Entity
于 2013-03-14T06:35:16.553 回答