A symfony integration for enm/shopware-sdk.
The Bundle provides the default implementation of enm/shopware-sdk
with guzzlehttp/guzzle
and jms/serializer
as service.
It requires the jms/serializer-bundle
to be enabled in the AppKernel
.
composer require enm/shopware-sdk-bundle
In your AppKernel
:
/**
* @return array
*/
public function registerBundles()
{
$bundles = [
// ...
new \JMS\SerializerBundle\JMSSerializerBundle(),
new \Enm\Bundle\ShopwareSdk\EnmShopwareSdkBundle(),
];
// ...
return $bundles;
}
Simply configure your shop connection over the global config.yml
:
enm_shopware_sdk:
base_url: "http://your-shop.com"
username: "test"
api_key: "test"
This bundle overwrites the default naming strategy of the serializer with IdenticalPropertyNamingStrategy
.
/** @var \Enm\Bundle\ShopwareSdk\EntryPoint $shopwareClient */
$entryPoint = $container->get('enm.shopware.entry_point');
php vendor/bin/phpunit