PHPackages                             draw/sonata-import-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. draw/sonata-import-bundle

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

draw/sonata-import-bundle
=========================

Generic customisable import system for sonata

0.39.2(2mo ago)011.5k↑158.3%MITPHPPHP &gt;=8.5

Since Apr 17Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/mpoiriert/sonata-import-bundle)[ Packagist](https://packagist.org/packages/draw/sonata-import-bundle)[ RSS](/packages/draw-sonata-import-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (20)Versions (62)Used By (0)

DrawSonataImportBundle
======================

[](#drawsonataimportbundle)

This bundle add a basic import from csv system of entities in Sonata.

> It's currently only support update of existing entities.

Base on a configuration you can set which entity can be imported.

When uploading a csv file the system will detect the list of attribute base on a header column. It will then try to detect the identifier and the mutator to update the entities.

Configuration
-------------

[](#configuration)

Here is an example of the configuration:

```
draw_sonata_import:
  classes:
    App\Entity\User:
      alias: 'User' #The alias will be used instead of the full class name in the dropdown and database
    App\Entity\Product:
      alias: 'Product'
```

This tell the system that it support import for **App\\Entity\\User** and **App\\Entity\\Product**.

Sonata admin
------------

[](#sonata-admin)

A new menu **Import** will be available on the lef menu to create a new import. A dropdown to specify which entity you are importing is available base on the configuration. There is also an action **Import** on the list view of the entities that will link directly to this page with the entity selected in the dropdown.

You must select a csv file from which the system will detect the header and will try to fill the column information. You can then adjust it manually and select to **Process** the file.

Column Information Extraction
-----------------------------

[](#column-information-extraction)

The system try to extract column information base on a **Draw\\Bundle\\SonataImportBundle\\Column\\ColumnBuilder\\ColumnBuilderInterface**. There is two extractor provider with the system, one that will set if a column is the identifier base on it's name (id only), another one that will check if there is a **setter** base on the header to assign the mutator.

Import
------

[](#import)

When importing data a event **Draw\\Bundle\\SonataImportBundle\\Event\\AttributeImportEvent** is dispatch for every entity/column. Listening to this event let you do custom import logic of the data. If you did process the event you need to stop is propagation. If the event was not stop, the import logic will fall back on the column mutator that was set.

The setter just do a simple set of the raw value in the column (that is always a string) so if it's a reference to another object you must implement a listener to do have a custom logic.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance86

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 97.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~11 days

Total

61

Last Release

77d ago

PHP version history (3 changes)0.10.17PHP &gt;=8.1

0.10.47PHP &gt;=8.2

0.39.0PHP &gt;=8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/8bb9496b48abc2bfd37ebafa9cc4b3b1307a369ad27f6514943408d9b5ff18a5?d=identicon)[mpoiriert](/maintainers/mpoiriert)

---

Top Contributors

[![mpoiriert](https://avatars.githubusercontent.com/u/4175616?v=4)](https://github.com/mpoiriert "mpoiriert (90 commits)")[![DumitracheAdrian](https://avatars.githubusercontent.com/u/12441524?v=4)](https://github.com/DumitracheAdrian "DumitracheAdrian (1 commits)")[![kiloumap](https://avatars.githubusercontent.com/u/17480546?v=4)](https://github.com/kiloumap "kiloumap (1 commits)")

---

Tags

symfonybundledraw

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/draw-sonata-import-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/draw-sonata-import-bundle/health.svg)](https://phpackages.com/packages/draw-sonata-import-bundle)
```

###  Alternatives

[opensky/runtime-config-bundle

This bundle provides a way to inject parameters into services at runtime by exposing a RuntimeParameterBag service, which functions exactly like Symfony2's own ParameterBags.

10949.5k1](/packages/opensky-runtime-config-bundle)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)[glooby/task-bundle

Scheduling of tasks for symfony made simple

3216.3k](/packages/glooby-task-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
