<?php
/**
* Data Definitions.
*
* LICENSE
*
* This source file is subject to the GNU General Public License version 3 (GPLv3)
* For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
* files that are distributed with this source code.
*
* @copyright Copyright (c) 2016-2019 w-vision AG (https://www.w-vision.ch)
* @license https://github.com/w-vision/DataDefinitions/blob/master/gpl-3.0.txt GNU General Public License version 3 (GPLv3)
*/
namespace Wvision\Bundle\DataDefinitionsBundle;
use CoreShop\Bundle\ResourceBundle\AbstractResourceBundle;
use CoreShop\Bundle\ResourceBundle\ComposerPackageBundleInterface;
use CoreShop\Bundle\ResourceBundle\CoreShopResourceBundle;
use Pimcore\Extension\Bundle\PimcoreBundleInterface;
use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\CleanerRegistryCompilerPass;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ExportProviderRegistryCompilerPass;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ExportRunnerRegistryCompilerPass;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\FetcherRegistryCompilerPass;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\FilterRegistryCompilerPass;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\GetterRegistryCompilerPass;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\InterpreterRegistryCompilerPass;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\LoaderRegistryCompilerPass;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\ProviderRegistryCompilerPass;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\RunnerRegistryCompilerPass;
use Wvision\Bundle\DataDefinitionsBundle\DependencyInjection\Compiler\SetterRegistryCompilerPass;
class DataDefinitionsBundle extends AbstractResourceBundle implements PimcoreBundleInterface, ComposerPackageBundleInterface
{
use PackageVersionTrait;
public function getContainerExtension()
{
if (null === $this->extension) {
$extension = $this->createContainerExtension();
if (null !== $extension) {
if (!$extension instanceof ExtensionInterface) {
throw new \LogicException(sprintf('Extension %s must implement Symfony\Component\DependencyInjection\Extension\ExtensionInterface.',
get_class($extension)));
}
$this->extension = $extension;
} else {
$this->extension = false;
}
}
if ($this->extension) {
return $this->extension;
}
}
/**
* {@inheritdoc}
*/
public function getPackageName()
{
return 'w-vision/data-definitions';
}
/**
* {@inheritdoc}
*/
public function getSupportedDrivers()
{
return [
CoreShopResourceBundle::DRIVER_PIMCORE,
];
}
/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $builder)
{
parent::build($builder);
$builder->addCompilerPass(new CleanerRegistryCompilerPass());
$builder->addCompilerPass(new FilterRegistryCompilerPass());
$builder->addCompilerPass(new InterpreterRegistryCompilerPass());
$builder->addCompilerPass(new ProviderRegistryCompilerPass());
$builder->addCompilerPass(new RunnerRegistryCompilerPass());
$builder->addCompilerPass(new SetterRegistryCompilerPass());
$builder->addCompilerPass(new LoaderRegistryCompilerPass());
$builder->addCompilerPass(new GetterRegistryCompilerPass());
$builder->addCompilerPass(new FetcherRegistryCompilerPass());
$builder->addCompilerPass(new ExportProviderRegistryCompilerPass());
$builder->addCompilerPass(new ExportRunnerRegistryCompilerPass());
}
/**
* {@inheritdoc}
*/
public function getNiceName()
{
return 'Data Definitions';
}
/**
* {@inheritdoc}
*/
public function getDescription()
{
return 'Data Definitions allows you to create reusable Definitions for Importing all kinds of data into DataObjects.';
}
/**
* {@inheritdoc}
*/
protected function getComposerPackageName()
{
return 'w-vision/data-definitions';
}
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 [];
}
}