PHPackages                             goldbach-algorithms/symfony-entity-exporter - 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. [Database &amp; ORM](/categories/database)
4. /
5. goldbach-algorithms/symfony-entity-exporter

ActiveLibrary[Database &amp; ORM](/categories/database)

goldbach-algorithms/symfony-entity-exporter
===========================================

Symfony Entity Exporter

1.3.1(4y ago)11301[1 issues](https://github.com/GoldbachAlgorithms/SymfonyEntityExporter/issues)MITPHP

Since Oct 28Pushed 2y agoCompare

[ Source](https://github.com/GoldbachAlgorithms/SymfonyEntityExporter)[ Packagist](https://packagist.org/packages/goldbach-algorithms/symfony-entity-exporter)[ RSS](/packages/goldbach-algorithms-symfony-entity-exporter/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (4)Versions (14)Used By (0)

Symfony Entity Exporter
=======================

[](#symfony-entity-exporter)

[![](https://camo.githubusercontent.com/bdad2a98e507fc39c91184af0b47d10395612d98fc654223eb92774d4b614cfc/68747470733a2f2f62616467656e2e6e65742f62616467652f506f776572656425323062792f476f6c64626163682f726564)](https://github.com/Goldbach07/)[![](https://camo.githubusercontent.com/6a72530325a531c4c779860eaf1b6d8a41540989348d7ed0da7def1c5c603f57/68747470733a2f2f62616467656e2e6e65742f62616467652f446576656c6f706564253230666f722f53796d666f6e792f3a626c61636b)](https://symfony.com/)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Goldbach Algorithms Symfony Entity Exporter (fondly nicknamed Entity Exporter) is a library developed for the Symfony framework with the objective of exporting information from the database in a simple way.

**Compatible output extensions: *CSV*, *XLS* and *PDF***

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

[](#installation)

Use the composer to install

```
composer require goldbach-algorithms/symfony-entity-exporter
```

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

[](#configuration)

Make the settings below according to your project's needs within your .env file

#### ENTITY\_PATH

[](#entity_path)

If you have changed the paron directory for entities in your project, you must set the ENTITY\_PATH variable within your .env file to indicate the new directory.

#### TRANSITORY\_MEMORY

[](#transitory_memory)

As an option it is also possible to define within the .env file of your project a value for the variable TRANSITORY\_MEMORY, which will change the php memory limit during the execution of the export to avoid crashes. The default value is 1GB.

Usage
-----

[](#usage)

See some examples of using Symfony Entity Exporter

**See the *.csv* export example**

```
use GoldbachAlgorithms\SymfonyEntityExporter\SymfonyEntityExporter;

# Instantiate a new Entity Exporter
$entityExporter = new SymfonyEntityExporter;

# Set $data (query return) and entity class
$response = $entityExporter->csv(
            $data,
            User::class,
            UserDataExport::class, # Data Export Template (not required)
            'Title', # Title (not required)
            'Filename', # File .csv name (not required)
            ';' # .csv Delimiter (not required) default ;
        );

# Exporting file (.csv)
return $response;
```

You can also generate a .pdf file from the entity query return.

**See the *.pdf* export example**

```
use GoldbachAlgorithms\SymfonyEntityExporter\SymfonyEntityExporter;

# Instantiate a new Entity Exporter
$entityExporter = new SymfonyEntityExporter;

# Set $data (query return) and entity class
$response = $entityExporter->pdf(
            $data,
            User::class,
            UserDataExport::class, # Data Export Template (not required)
            'Filename', # File .pdf name (not required),
            'Header content', # (not required)
            'Footer content', # (not required)
            'P', # Portrait or Landscape (not required)
            '10', # Margin Header (not required)
            '10', # Margin Footer (not required)
            '10', # Top content margin (not required)
            'A4', # Print Format (not required)
            'utf-8', # Char Mode (not required)
        );

# Exporting file (.pdf)
return $response;
```

And you can also export an html template, for example a twig file

**See the *.pdf* by html export example**

```
use GoldbachAlgorithms\SymfonyEntityExporter\SymfonyEntityExporter;

# Instantiate a new Entity Exporter
$entityExporter = new SymfonyEntityExporter;

# Set a content
$content = $this->renderView('content.html.twig', $vars);

# Call the method pdfByHtml()
$response = $entityExporter->pdfByHtml(
            $content,
            'Filename', # File .pdf name (not required),
            'Header content', # (not required)
            'Footer content', # (not required)
            'P', # Portrait or Landscape (not required)
            '10', # Margin Header (not required)
            '10', # Margin Footer (not required)
            '10', # Top content margin (not required)
            'A4', # Print Format (not required)
            'utf-8', # Char Mode (not required)
        );

# Exporting file (.pdf)
return $response;
```

You can create an export template following the example in [src/ExampleDataExport.php](https://github.com/GoldbachAlgorithms/SymfonyEntityExporter/blob/main/src/ExampleDataExport.php) by adding a App\\DataExport directory to your application.

EasyAdminBundle
---------------

[](#easyadminbundle)

The Entity Exporter is compatible with the Easy Admin Bundle, so it is possible to use a request within a Controller on the page and perform data export.

**See the *.xls* export example**

```
use EasyCorp\Bundle\EasyAdminBundle\Factory\AdminContextFactory;
use GoldbachAlgorithms\SymfonyEntityExporter\SymfonyEntityExporter;

# Inject the AdminContextFactory and define public

/** @var AdminContextFactory  */
public $adminContextFactory;

public function __construct(AdminContextFactory $adminContextFactory)
{
   $this->adminContextFactory = $adminContextFactory;
}

# Instantiate a new Entity Exporter
$entityExporter = new SymfonyEntityExporter;

# Get the FilterFactory into Controller
$filterFactory = $this->get(FilterFactory::class);

# Use the Entity Exporter builder to EasyAdmin
$data = $entityExporter->getEasyAdminQuery(
            $request,
            $filterFactory,
            $this,
            [
                'id' => 1
            ]
        );

# Set $data (query return) and entity class
$response = $entityExporter->xls($data, User::class);

# File .xls
return $response;
```

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

Copyright © 2021 [Goldbach Algorithms](https://github.com/GoldbachAlgorithms/SymfonyEntityExporter/blob/main/LICENSE)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% 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 ~0 days

Total

13

Last Release

1654d ago

Major Versions

0.1.6 → 1.02021-10-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc5d31ed985a2b808619a74f37d32228ea19c22b0aff02e54877c5a66bfe3ead?d=identicon)[Goldbach07](/maintainers/Goldbach07)

---

Top Contributors

[![Goldbach07](https://avatars.githubusercontent.com/u/13986904?v=4)](https://github.com/Goldbach07 "Goldbach07 (22 commits)")[![krixer](https://avatars.githubusercontent.com/u/1197537?v=4)](https://github.com/krixer "krixer (1 commits)")

---

Tags

csveasyadminentityexportgoldbachgoldbach-algorithmshtmlpdfsymfonyxlssymfonypdfdatabaseexporthtmlxlscsvexporterdbentity

### Embed Badge

![Health badge](/badges/goldbach-algorithms-symfony-entity-exporter/health.svg)

```
[![Health](https://phpackages.com/badges/goldbach-algorithms-symfony-entity-exporter/health.svg)](https://phpackages.com/packages/goldbach-algorithms-symfony-entity-exporter)
```

###  Alternatives

[kartik-v/yii2-export

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)

1623.1M35](/packages/kartik-v-yii2-export)[rah/danpu

Zero-dependency MySQL dump library for easily exporting and importing databases

64401.8k10](/packages/rah-danpu)[jgrygierek/batch-entity-import-bundle

Importing entities with preview and edit features for Symfony.

101.1M1](/packages/jgrygierek-batch-entity-import-bundle)[phpnt/yii2-export

Yii2 It saves data in xls, csv, word, html, pdf files.

158.9k](/packages/phpnt-yii2-export)[lastzero/doctrine-active-record

Object-oriented CRUD for Doctrine DBAL

306.0k](/packages/lastzero-doctrine-active-record)[nilgems/laravel-textract

A Laravel package to extract text from files like DOC, XL, Image, Pdf and more. I've developed this package by inspiring "npm textract".

195.2k](/packages/nilgems-laravel-textract)

PHPackages © 2026

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