webit / shipment-bundle
Web-IT 发货库 Symfony 2 集成
3.1.1
2021-03-09 15:04 UTC
Requires
- php: >=5.4.16
- doctrine/doctrine-bundle: ^1.4
- doctrine/orm: ^2.4
- symfony/symfony: ^2.5|^3.0
- webit/shipment: ^3.1.0
Requires (Dev)
- behat/behat: ~3.0
- jms/serializer-bundle: ~1.0
- phpunit/phpunit: ~4.2
- webit/test-tools: *
Suggests
- jms/serializer-bundle: JMS Serializer support
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