PHPackages                             sostheng/entity-portation-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. [File &amp; Storage](/categories/file-storage)
4. /
5. sostheng/entity-portation-bundle

AbandonedArchivedSymfony-bundle[File &amp; Storage](/categories/file-storage)

sostheng/entity-portation-bundle
================================

This is a bundle that allows you to simply export entities arrays using PHPExcel

033PHP

Since May 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/SosthenG/EntityPortationBundle)[ Packagist](https://packagist.org/packages/sostheng/entity-portation-bundle)[ RSS](/packages/sostheng-entity-portation-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

EntityPortationBundle
=====================

[](#entityportationbundle)

This is a bundle that allows you to simply export entities arrays using PHPExcel.

Simply place annotations on the elements of a class you want portable and the EntityPortationBundle will do the rest! Pass it the list of entities to export and enjoy!

For now, only basic export is available but reading CSV/Excel files and creating entities from it is planned.

Please note that this bundle is still in development and may have some bugs or weird behaviors. Do not hesitate to send your feedbacks!

License
-------

[](#license)

[![License](https://camo.githubusercontent.com/8c0ed5d433b45a8ac5bc946a3b375c2bce29840f521c9ceea02a8ae2772c3df6/68747470733a2f2f706f7365722e707567782e6f72672f736f737468656e672f656e746974792d706f72746174696f6e2d62756e646c652f6c6963656e7365)](https://github.com/SosthenG/EntityPortationBundle/blob/master/LICENSE)

Installation
------------

[](#installation)

**1** Add to composer.json

```
    $composer require sostheng/entity-portation-bundle
```

**2** Register the bundle in `app/AppKernel.php`

```
    $bundles = array(
        // ...
        new SosthenG\EntityPortationBundle\EntityPortationBundle(),
    );
```

How to use
----------

[](#how-to-use)

This bundle uses annotations to detect what it needs to export. To use annotations, you must to include these two classes :

```
use SosthenG\EntityPortationBundle\Annotation\EntityPortation; // To pass custom parameters for the export
use SosthenG\EntityPortationBundle\Annotation\PortationGetter; // Required to tell which getter will be portable
```

Here is an example with all the parameters filled :

```
/**
 * @EntityPortation(csvDelimiter=";", sheetTitle="My sheet Title", fallBackValue="N/A")
 */
 class MyClass {
    private $field;

    /**
     * @PortationGetter(label="Rôles", position="auto", visible=true, valueType="string")
     */
    public function getField()
    {
        return $this->_field;
    }
 }
```

They are all optionnal, the only required thing is to use the @PortationGetter() annotation on the getters you want to use for exports.

You've done the hardest! Now, just create an Export object, add extra parameters or change somes if you want, and get you exported file!

```
    /**
     * @Route("export/{format}", name="export", requirements={"format" = "PDF|Excel2007|Excel5|CSV|HTML|OpenDocument"})
     */
    public function exportAction($format) {
        $entities = $this->getDoctrine()->getManager()->getRepository("Bundle:MyClass")->findAll();

        $exporter = new Export($this->get("phpexcel"), $this->get("translator"));

        $exporter->setEntities($entities);

        // You can save the export as file or get a response from now, but if you want, you can change some parameters

        $prop = $exporter->getProperties(); // Returns the PhpExcel Properties object.
        $prop->setAuthor("You"); // Check the PHPExcel documentation for other parameters

        $exporter->setAllVisible(true);
        // etc.

        // Save the file
        $file = $exporter->saveAsFile($format, "web/files/myFileName"); // Extension is optionnal, it will be added if not filled
        // or return it as a Response
        return $exporter->getResponse($format, "myFileName");
    }
```

Some documentation
------------------

[](#some-documentation)

This bundle uses the [ExcelBundle](https://github.com/liuggio/ExcelBundle/) from liuggio, which is a [PhpExcel](https://github.com/PHPOffice/PHPExcel/) integration for Symfony.

Documentation for this bundle
-----------------------------

[](#documentation-for-this-bundle)

Not yet available. Let me finish it first :)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22033159?v=4)[Sosthèn Gaillard](/maintainers/SosthenG)[@SosthenG](https://github.com/SosthenG)

---

Top Contributors

[![SosthenG](https://avatars.githubusercontent.com/u/22033159?v=4)](https://github.com/SosthenG "SosthenG (17 commits)")

### Embed Badge

![Health badge](/badges/sostheng-entity-portation-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/sostheng-entity-portation-bundle/health.svg)](https://phpackages.com/packages/sostheng-entity-portation-bundle)
```

###  Alternatives

[venveo/craft-compress

Create smart zip files from Craft assets on the fly

124.7k](/packages/venveo-craft-compress)

PHPackages © 2026

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