Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Delta Export Bundle Laravel Package

akeneo/delta-export-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation Add the bundle to your composer.json:

    composer require akeneo/delta-export-bundle:1.0.0-BETA2
    

    Register the bundle in app/AppKernel.php:

    new Akeneo\Bundle\DeltaExportBundle\AkeneoDeltaExportBundle(),
    
  2. Configuration Ensure your config.yml includes Akeneo PIM’s base config (required for compatibility):

    akeneo_pim:
        # ... existing Akeneo PIM config ...
    
  3. First Use Case Trigger a delta export via CLI:

    php app/console akeneo:delta-export:export --entity=product --identifier=123
    

    Verify output in var/export/delta/ (default path).


Implementation Patterns

Core Workflows

  1. Delta Export Triggering

    • CLI: Use akeneo:delta-export:export command with --entity (e.g., product, family) and --identifier (e.g., SKU or ID).
    • Event-Based: Subscribe to Akeneo\Bundle\DeltaExportBundle\Event\ExportDeltaEvent to automate exports post-save:
      // services.yml
      akeneo.delta_export.listener:
          class: AppBundle\EventListener\DeltaExportListener
          tags:
              - { name: kernel.event_listener, event: akeneo_delta_export.export_delta, method: onExport }
      
  2. Customizing Export Format Override the default CSV exporter by extending Akeneo\Bundle\DeltaExportBundle\Exporter\CsvExporter:

    namespace AppBundle\Exporter;
    use Akeneo\Bundle\DeltaExportBundle\Exporter\CsvExporter as BaseExporter;
    
    class CustomCsvExporter extends BaseExporter {
        protected function getHeader() {
            return ['custom_field', 'original_header'];
        }
    }
    

    Register in services.yml:

    akeneo.delta_export.exporter.csv:
        class: AppBundle\Exporter\CustomCsvExporter
        tags:
            - { name: akeneo.delta_export.exporter, type: csv }
    
  3. Batch Processing For large datasets, implement chunked exports by extending Akeneo\Bundle\DeltaExportBundle\Processor\BatchProcessor:

    $processor = new BatchProcessor($entityManager, $exporter, 100); // 100 items per batch
    $processor->process($deltaEntities);
    

Integration Tips

  • Akeneo PIM Sync: Use delta exports to sync only modified products to external systems (e.g., ERP, e-commerce).
  • Webhooks: Combine with symfony/process to send exported files via HTTP POST to downstream services.
  • Logging: Enable debug mode in config.yml to log delta changes:
    akeneo_delta_export:
        debug: true
    

Gotchas and Tips

Pitfalls

  1. Deprecation Risk

    • The package is archived (last release: 2014) and tied to Akeneo PIM 1.1. Use only if maintaining legacy systems.
    • Mitigation: Fork the repo and update dependencies (e.g., Symfony 2 → 3/4) if critical.
  2. Entity-Specific Quirks

    • Delta exports only work for entities with @Akeneo\Tool\Bundle\VersioningBundle\Annotation\Versioned. Verify your entity has this annotation.
    • Debugging: Check var/log/dev.log for Akeneo\Bundle\DeltaExportBundle\Exception\UnsupportedEntityException.
  3. File Overwrite Behavior

    • Exports default to overwriting files in var/export/delta/. Add timestamps to filenames to avoid conflicts:
      $filename = sprintf('delta_%s_%s.csv', $entityName, (new \DateTime())->format('YmdHis'));
      

Debugging

  • Enable Verbose Output:
    php app/console akeneo:delta-export:export --entity=product --verbose
    
  • Check Delta Calculation: The bundle uses Akeneo\Tool\Bundle\VersioningBundle\Manager\VersionManager to detect changes. Override this manager to customize delta logic:
    services:
        akeneo.delta_export.version_manager:
            class: AppBundle\Versioning\CustomVersionManager
            parent: akeneo_versioning.version_manager
    

Extension Points

  1. Custom Delta Criteria Extend Akeneo\Bundle\DeltaExportBundle\Criteria\DeltaCriteria to filter deltas (e.g., by date or attribute):

    class CustomDeltaCriteria extends DeltaCriteria {
        public function addDateFilter(\DateTime $since) {
            $this->addWhere('e.updated >= ?', $since->format('Y-m-d H:i:s'));
        }
    }
    
  2. Post-Export Actions Hook into akeneo_delta_export.post_export event to process files (e.g., compress, upload):

    public function onPostExport(PostExportEvent $event) {
        $file = $event->getFile();
        // Add custom logic (e.g., FTP upload)
    }
    
  3. Performance

    • Indexing: Ensure your database has indexes on updated_at fields for large datasets.
    • Memory Limits: Increase memory_limit in php.ini if processing >10K entities (default PHP limits may fail).
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity