Search by

jgrygierek / batch-entity-import-bundle

jgrygierek

Importing entities with preview and edit features for Symfony.

Package info

github.com/jgrygierek/BatchEntityImportBundle

Type:symfony-bundle

pkg:composer/jgrygierek/batch-entity-import-bundle

Statistics

Installs: 1 076 711

Dependents: 1

Suggesters: 0

Stars: 12

Open Issues: 1

v3.14.0 2026-11-15 17:14 UTC

README

Code Style Tests Code Coverage PHP Versions Symfony Versions SymfonyInsight

Importing entities with preview and edit features for Symfony.

  • Data can be viewed and edited before saving to database.
  • Supports inserting new records and updating existing ones.
  • Supported extensions: CSV, XLS, XLSX, ODS.
  • Supports translations from KnpLabs Translatable extension.
  • Import can be adjusted in configuration class (fields, validation, allowed columns, creating entities), in controller (templates, views) and by events (e.g. converting values to dates).
  • Columns names are required and should be added as header (first row).
  • If column does not have name provided, will be removed from loaded data.

Select File Edit Matrix

Versions

Version Status Last release PHP Symfony Documentation
4.x Actively developed - >= 8.4 7.4, 8.* master
3.x Not maintained 3.14.0 >= 8.3 6.4, 7.*, 8.* v3.14.0
2.x Not maintained 2.6.0 >= 7.4 4.4, 5.*, 6.* v2.6.0
1.x Not maintained 1.1.5 >= 7.4 4.4, 5.* v1.1.5

Requirements of PHP and Symfony are given for the last release of each version.

Changes between versions and steps needed to upgrade are described in UPGRADE.md.

Installation

Install package via composer:

composer require jgrygierek/batch-entity-import-bundle

If your project can't be upgraded to requirements of version 4 yet, install version 3:

composer require jgrygierek/batch-entity-import-bundle:^3.14

If your application uses Symfony Flex, bundle is registered automatically. Otherwise add entry to config/bundles.php file:

JG\BatchEntityImportBundle\BatchEntityImportBundle::class => ['all' => true],

Documentation

  • Configuration class - entity to import, types of fields, validation, allowed columns, creating entities and file extensions.
  • Controller - controller with import actions.
  • Import files - rules for header and rows, CSV delimiter and encoding, size limit, translatable columns, changing the way of reading files, full example of file.
  • Overriding templates - global and controller-specific templates, main layout, additional data.
  • Updating entities - updating existing records instead of inserting new ones, field used to select them.
  • Events - events dispatched during import, converting values (e.g. dates) and changing entities before saving.
  • Importing data to array field - values with separator imported as array.
  • Importing relations - ManyToOne and OneToOne relations imported by value of any field.
  • Upgrade notes - changes between versions.