PHPackages                             doctrs/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. doctrs/sonata-import-bundle

ActiveSymfony-bundle

doctrs/sonata-import-bundle
===========================

Import bundle to the Sonata Admin Bundle

1.3(8y ago)74.6k11[1 issues](https://github.com/Doctrs/SonataImportBundle/issues)[1 PRs](https://github.com/Doctrs/SonataImportBundle/pulls)MITPHPPHP &gt;=5.6

Since Sep 26Pushed 5y ago4 watchersCompare

[ Source](https://github.com/Doctrs/SonataImportBundle)[ Packagist](https://packagist.org/packages/doctrs/sonata-import-bundle)[ Docs](https://github.com/Doctrs/SonataImportBundle)[ RSS](/packages/doctrs-sonata-import-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (9)Used By (0)

Sonata Import Bundle
====================

[](#sonata-import-bundle)

Add import to sonata admin bundle

[![Build Status](https://camo.githubusercontent.com/ac5b15a8a01a9fdee1083a14d16d8ee5eaa4f1b7537768ca66bf594bda91c7cf/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f446f637472732f536f6e617461496d706f727442756e646c652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Doctrs/SonataImportBundle/build-status/master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f955d3a6ad2f843cfcceea2d46497b5ebc3254b3d6ab7e61cd7736b4a73e1f3e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f446f637472732f536f6e617461496d706f727442756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572263233)](https://scrutinizer-ci.com/g/Doctrs/SonataImportBundle/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/95a1fec23408a1416ad039516f3473ab0a1b069da48ba45784654364dd7c0f1f/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39613037336562382d666466652d343932302d383265642d3432353637313666656262382f6d696e692e706e67)](https://insight.sensiolabs.com/projects/9a073eb8-fdfe-4920-82ed-4256716febb8)

Installation
============

[](#installation)

Run

```
composer require doctrs/sonata-import-bundle
```

Register the bundle in your `AppKernel.php`

```
new Doctrs\SonataImportBundle\DoctrsSonataImportBundle()
```

If you have not bundle `white-october/pagerfanta-bundle` register this in `AppKernel.php` too.

```
new WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle(),
```

Add orm mapping in your config.yml

```
doctrine:
    # ...
    orm:
        # ...
        entity_managers:
            default:
                mappings:
                    DoctrsSonataImportBundle: ~
```

Add settings of bundle

```
doctrs_sonata_import:
    mappings:
    #   - { name: center_point, class: doctrs.form_format.point}
    #   - { name: city_autocomplete, class: doctrs.form_format.city_pa}
        - { name: date, class: doctrs.type.datetime}
        - { name: datetime, class: doctrs.type.datetime}
        - { name: boolean, class: doctrs.type.boolean}
        - { name: integer, class: doctrs.type.integer}
        - { name: entity, class: doctrs.type.entity}
        - { name: choice, class: doctrs.type.entity}
    upload_dir: %kernel.root_dir%/../web/uploads
    class_loaders:
        - { name: CSV, class: Doctrs\SonataImportBundle\Loaders\CsvFileLoader}
    #   - { name: XLS, class: AppBundle\Loader\Doctrs\XlsFileLoader}
    encode:
        default: utf8
        list:
            - cp1251
            - utf8
            - koir8
```

Update your database

```
php app/console doctrine:migrations:diff
php app/console doctrine:migrations:migrate

```

If you have not migrations run this

```
php app/console doctrine:schema:update --force

```

Installation of bundle success

Change sonataAdminBundle entities
---------------------------------

[](#change-sonataadminbundle-entities)

Add or change methods `configureRoutes` and `getDashboardActions` in sonata admin classes

```
use Sonata\AdminBundle\Admin\AbstractAdmin;
...
class AnyClassAdmin extends AbstractAdmin {
...
    protected function configureRoutes(RouteCollection $collection)
    {
        $collection->add('import', 'import', [
            '_controller' => 'DoctrsSonataImportBundle:Default:index'
        ]);
        $collection->add('upload', '{id}/upload', [
            '_controller' => 'DoctrsSonataImportBundle:Default:upload'
        ]);
        $collection->add('importStatus', '{id}/upload/status', [
            '_controller' => 'DoctrsSonataImportBundle:Default:importStatus'
        ]);
    }
    ...
    public function getDashboardActions()
    {
        $actions = parent::getDashboardActions();

        $actions['import'] = array(
            'label'              => 'Import',
            'url'                => $this->generateUrl('import'),
            'icon'               => 'upload',
            'template'           => 'SonataAdminBundle:CRUD:dashboard__action.html.twig', // optional
        );

        return $actions;
    }
```

If you don't redefined these methods you can use trait

```
use Doctrs\SonataImportBundle\Admin\AdminImportTrait;
use Sonata\AdminBundle\Admin\AbstractAdmin;
...
class AnyClassAdmin extends AbstractAdmin {
...
use AdminImportTrait;
```

Both methods add in `AdminImportTrait`

###  Health Score

34

—

LowBetter than 79% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 86.4% 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 ~13 days

Recently: every ~19 days

Total

7

Last Release

3019d ago

PHP version history (2 changes)1.0PHP &gt;=5.4

1.0.1PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd94a4e49dba6c5f819572b6e282fd592b50bd73a24e6f42857f1f325385faba?d=identicon)[DOC\_tr](/maintainers/DOC_tr)

---

Top Contributors

[![Doctrs](https://avatars.githubusercontent.com/u/3328895?v=4)](https://github.com/Doctrs "Doctrs (38 commits)")[![eawd](https://avatars.githubusercontent.com/u/2342916?v=4)](https://github.com/eawd "eawd (3 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (2 commits)")[![jumper423](https://avatars.githubusercontent.com/u/12099016?v=4)](https://github.com/jumper423 "jumper423 (1 commits)")

---

Tags

symfonyimportsonata

### Embed Badge

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

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

###  Alternatives

[sonata-project/doctrine-orm-admin-bundle

Integrate Doctrine ORM into the SonataAdminBundle

44917.5M144](/packages/sonata-project-doctrine-orm-admin-bundle)[jgrygierek/sonata-batch-entity-import-bundle

Importing entities with preview and edit features for Sonata Admin.

10919.1k](/packages/jgrygierek-sonata-batch-entity-import-bundle)[picoss/sonata-extra-admin-bundle

Sonata Extra admin features

1862.3k](/packages/picoss-sonata-extra-admin-bundle)

PHPackages © 2026

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