-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
Bundle initialization, helper and processors/writers
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?phpnamespace DnD\Bundle\MagentoConnectorBundle\DependencyInjection;use Symfony\Component\HttpKernel\DependencyInjection\Extension;use Symfony\Component\DependencyInjection\ContainerBuilder;use Symfony\Component\DependencyInjection\Loader;use Symfony\Component\Config\FileLocator;/** * Base connector bundle extension * * @author DnD Mimosa <[email protected]> * @copyright 2014 Agence Dn'D (http://www.dnd.fr) * @license Agence Dn'D */class DnDMagentoConnectorExtension extends Extension{ /** * {@inheritdoc} */ public function load(array $configs, ContainerBuilder $container) { $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('readers.yml'); $loader->load('processors.yml'); $loader->load('writers.yml'); }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?phpnamespace DnD\Bundle\MagentoConnectorBundle\Processor;use Symfony\Component\Validator\Constraints as Assert;use Akeneo\Bundle\BatchBundle\Item\ItemProcessorInterface;use Akeneo\Bundle\BatchBundle\Item\AbstractConfigurableStepElement;use Gedmo\Sluggable\Util\Urlizer;/** * * @author Mimosa <[email protected]>, Merlin <[email protected]> * @copyright 2014 Dn'D (http://www.dnd.fr) * @license http://www.dnd.fr */class AttributeProcessor extends AbstractConfigurableStepElement implements ItemProcessorInterface{ /** * {@inheritdoc} */ public function process($item) { $result = []; $result['type'] = $item->getAttributeType(); $result['code'] = $item->getCode(); $result['label-en_US'] = $item->setLocale('en_US')->getLabel(); $result['label-fr_FR'] = $item->setLocale('fr_FR')->getLabel(); $result['group'] = $item->getGroup()->getCode(); $result['unique'] = ($item->isUnique()) ? 1 : 0; $result['useable_as_grid_column'] = ($item->isUseableAsGridColumn()) ? 1 : 0; $result['useable_as_grid_filter'] = ($item->isUseableAsGridFilter()) ? 1 : 0; $result['allowed_extensions'] = ''; $result['metric_family'] = ''; $result['default_metric_unit'] = ''; $result['localizable'] = ($item->isLocalizable()) ? 1 : 0; $result['scopable'] = ($item->isScopable()) ? 1 : 0; if($item->getAttributeType() == 'pim_catalog_metric'){ $result['metric_family'] = $item->getMetricFamily(); $result['default_metric_unit'] = $item->getDefaultMetricUnit(); } if($item->getAttributeType() == 'pim_catalog_image'){ $result['allowed_extensions'] = implode(",", $item->getAllowedExtensions()); } $families = array(); foreach($item->getFamilies() as $family){ array_push($families, $family->getCode()); } $result['families'] = implode(",", $families); return $result; } /** * {@inheritdoc} */ public function getConfigurationFields() { return array(); }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?phpnamespace DnD\Bundle\MagentoConnectorBundle\Processor;use Symfony\Component\Validator\Constraints as Assert;use Pim\Bundle\BaseConnectorBundle\Validator\Constraints\Channel as ChannelConstraint;use Pim\Bundle\CatalogBundle\Manager\ChannelManager;use Akeneo\Bundle\BatchBundle\Item\ItemProcessorInterface;use Akeneo\Bundle\BatchBundle\Item\AbstractConfigurableStepElement;/** * * @author Mimosa <[email protected]> * @copyright 2014 Agence Dn'D (http://www.dnd.fr) * @license http://www.dnd.fr */ class FamilyProcessor extends AbstractConfigurableStepElement implements ItemProcessorInterface{ /** * {@inheritdoc} */ public function process($family) { $result = []; $result['code'] = $family->getCode(); $result['label'] = $family->setLocale('fr_FR')->getLabel(); return $result; } /** * {@inheritdoc} */ public function getConfigurationFields() { return array(); } } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?phpnamespace DnD\Bundle\MagentoConnectorBundle\Writer\File;/** * Interface for file writer that supports archiving the results * * @author Filips Alpe <[email protected]> * @copyright 2013 Akeneo SAS (http://www.akeneo.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */interface ArchivableWriterInterface{ /** * Return an array of files written by the writer in the following format: * array( * '/full/path/to/the/file' => 'path/relative/to/the/export/directory' * ) * * @return array */ public function getWrittenFiles();} | ||
|