From c2f8b241ad583d8317b0f37dbf97fe4b76f84352 Mon Sep 17 00:00:00 2001 From: Dominik Pfaffenbauer Date: Wed, 4 Apr 2018 15:38:04 +0200 Subject: [PATCH] Use DependantBundle that will be introduced in beta-1 from coreshop-resource-bundle --- README.md | 21 +----- .../ImportDefinitionsBundle.php | 73 +++++++++++++++++-- 2 files changed, 69 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 677efbb8..21f81028 100644 --- a/README.md +++ b/README.md @@ -17,25 +17,8 @@ Import Definitions allows you to define your Object Import using a nice GUI and * Since Import-Definitions depends on CoreShops ResourceBundle, and the ResourceBundle only exists in DEV yet, you need to set your "minimum-stability" to "dev" in your composer.json * Install via composer ```composer require w-vision/import-definitions:^2.0-dev``` - * Load needed Bundles: - ```php - addBundles(array( - new \JMS\SerializerBundle\JMSSerializerBundle(), - new \CoreShop\Bundle\ResourceBundle\CoreShopResourceBundle(), - new \FOS\RestBundle\FOSRestBundle(), - new \Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle(), - new \Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle() - ), 120); - } - ``` - * Enable Bundle by running ```bin/console pimcore:bundle:enable ImportDefinitionsBundle``` - * Clear Cache by running ```bin/console cache:clear --no-warmup``` - * Install Bundle by running ```bin/console pimcore:bundle:install ImportDefinitionsBundle``` + * Enable via command-line (or inside the pimcore extension manager): ```bin/console pimcore:bundle:enable ImportDefinitionsBundle``` + * Install via command-line (or inside the pimcore extension manager): ```bin/console pimcore:bundle:install ImportDefinitionsBundle``` * Reload Pimcore * Open Settings -> Import Definitions diff --git a/src/ImportDefinitionsBundle/ImportDefinitionsBundle.php b/src/ImportDefinitionsBundle/ImportDefinitionsBundle.php index 63e8c483..e3f8c622 100644 --- a/src/ImportDefinitionsBundle/ImportDefinitionsBundle.php +++ b/src/ImportDefinitionsBundle/ImportDefinitionsBundle.php @@ -14,19 +14,40 @@ namespace ImportDefinitionsBundle; -use Pimcore\Extension\Bundle\AbstractPimcoreBundle; -use Pimcore\Extension\Bundle\Traits\PackageVersionTrait; -use Symfony\Component\DependencyInjection\ContainerBuilder; +use CoreShop\Bundle\ResourceBundle\AbstractResourceBundle; +use CoreShop\Bundle\ResourceBundle\ComposerPackageBundleInterface; +use CoreShop\Bundle\ResourceBundle\CoreShopResourceBundle; use ImportDefinitionsBundle\DependencyInjection\Compiler\CleanerRegistryCompilerPass; use ImportDefinitionsBundle\DependencyInjection\Compiler\FilterRegistryCompilerPass; use ImportDefinitionsBundle\DependencyInjection\Compiler\InterpreterRegistryCompilerPass; use ImportDefinitionsBundle\DependencyInjection\Compiler\ProviderRegistryCompilerPass; use ImportDefinitionsBundle\DependencyInjection\Compiler\RunnerRegistryCompilerPass; use ImportDefinitionsBundle\DependencyInjection\Compiler\SetterRegistryCompilerPass; +use Pimcore\Extension\Bundle\PimcoreBundleInterface; +use Pimcore\Extension\Bundle\Traits\PackageVersionTrait; +use Symfony\Component\DependencyInjection\ContainerBuilder; -class ImportDefinitionsBundle extends AbstractPimcoreBundle +class ImportDefinitionsBundle extends AbstractResourceBundle implements PimcoreBundleInterface, ComposerPackageBundleInterface { - use PackageVersionTrait; + use PackageVersionTrait; + + /** + * {@inheritdoc} + */ + public function getPackageName() + { + return 'w-vision/import-definitions'; + } + + /** + * {@inheritdoc} + */ + public function getSupportedDrivers() + { + return [ + CoreShopResourceBundle::DRIVER_PIMCORE, + ]; + } /** * {@inheritdoc} @@ -65,4 +86,44 @@ public function getInstaller() { return $this->container->get(Installer::class); } -} + + /** + * {@inheritdoc} + */ + public function getAdminIframePath() + { + return null; + } + + /** + * {@inheritdoc} + */ + public function getJsPaths() + { + return []; + } + + /** + * {@inheritdoc} + */ + public function getCssPaths() + { + return []; + } + + /** + * {@inheritdoc} + */ + public function getEditmodeJsPaths() + { + return []; + } + + /** + * {@inheritdoc} + */ + public function getEditmodeCssPaths() + { + return []; + } +} \ No newline at end of file