webit/shipment-bundle

Web-IT 发货库 Symfony 2 集成

安装: 147

依赖项: 2

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 0

公开问题: 0

类型:symfony-bundle

3.1.1 2021-03-09 15:04 UTC

This package is auto-updated.

Last update: 2024-09-09 22:17:04 UTC


README

发货库 Symfony 2 集成

安装

通过 Composer

webit/shipment-bundle 添加到 composer.json

{
    "require": {
        "php":              ">=5.3.2",
        "webit/shipment-bundle": "dev-master"
    },
    "autoload": {
        "psr-0": {
            "Acme": "src/"
        }
    }
}

在 Kernel 中注册 Bundle

添加以下行

// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new Webit\Bundle\ShipmentBundle\WebitShipmentBundle(),
    new Doctrine\Bundle\DoctrineBundle\DoctrineBundle()
    // ...
);

注意:请记得在 DoctrineBundle 之前添加 WebitShipmentBundle(因为目标实体解析器)

配置

您可以定义您需要的任何数量的账户(ADE 账户以及跟踪与追踪)

webit_shipment:
    orm:
        entities:
            sender_address: Your\SenderAddress\Entity # required
            delivery_address: Your\DeliveryAddress\Entity # required
            consignment: Webit\Bundle\ShipmentBundle\Entity\Consignment # default, can skip
            parcel: Webit\Bundle\ShipmentBundle\Entity\Parcel # default, can skip
            dispatch_confirmation: Webit\Bundle\ShipmentBundle\Entity\DispatchConfirmation # default, can skip

映射

如果您打算为实体使用默认实现,请将以下行添加到 ORM 配置中

yaml
doctrine:
    dbal:
    # your dbal config here
    orm:
        auto_generate_proxy_classes: %kernel.debug%
        auto_mapping: true
        # only these lines are added additionally
        mappings:
            WebitShipmentBundle:
                type: xml
                prefix: Webit\Bundle\ShipmentBundle\Entity
                dir: %kernel.root_dir%/../vendor/webit/shipment-bundle/src/Resources/config/doctrine/orm

要了解更多关于 发货库 的信息,请参阅 https://github.com/dbojdo/shipment