PHPackages                             flexmodel/flexmodel-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. [Database &amp; ORM](/categories/database)
4. /
5. flexmodel/flexmodel-bundle

AbandonedArchivedSymfony-bundle[Database &amp; ORM](/categories/database)

flexmodel/flexmodel-bundle
==========================

FlexModel integration for Symfony 3+.

1.0.5(8y ago)16.6k6[8 issues](https://github.com/FlexModel/FlexModelBundle/issues)1MITPHPPHP ^5.5 | ^7.0

Since May 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/FlexModel/FlexModelBundle)[ Packagist](https://packagist.org/packages/flexmodel/flexmodel-bundle)[ RSS](/packages/flexmodel-flexmodel-bundle/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (10)Dependencies (10)Versions (11)Used By (1)

FlexModelBundle
===============

[](#flexmodelbundle)

[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE.md)

FlexModel integration for Symfony.

Installation using Composer
---------------------------

[](#installation-using-composer)

Run the following command to add the package to the composer.json of your project:

```
$ composer require flexmodel/flexmodel-bundle
```

### Enable the bundle

[](#enable-the-bundle)

Enable the bundle in the kernel:

```
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new FlexModel\FlexModelBundle\FlexModelBundle(),
        // ...
    );
}
```

### Configure the bundle

[](#configure-the-bundle)

Add the following configuration to your `config.yml` file:

```
# app/config/config.yml

flex_model:
    bundle_name: AppBundle # optional, defaults to 'AppBundle'
    resource: "%kernel.root_dir%/../src/AppBundle/Resources/config/flexmodel.xml"
```

The `resource` should refer to the location of your FlexModel configuration file.

Usage
-----

[](#usage)

### Generating Doctrine ORM mapping

[](#generating-doctrine-orm-mapping)

Run the following command to generate Doctrine ORM mapping and entity classes from your FlexModel configuration:

```
$ php bin/console flexmodel:generate
```

After generating the Doctrine ORM mapping you need to update your database schema:

```
$ php bin/console doctrine:schema:update --force
```

### Creating a Form

[](#creating-a-form)

To create a form from a FlexModel form configuration you need to use the `FlexModelFormType` class.

The class will retrieve the form configuration based on the name of the entity and provided 'form\_name' option.

```
// src/AppBundle/Controller/DefaultController.php

public function newAction()
{
    $entity = ...;
    $form = $this->createForm(FlexModelFormType::class, $entity, array(
        'form_name' => '',
    ));
}
```

For more information on creating forms, please see the [Symfony documentation](http://symfony.com/doc/current/book/forms.html).

### File uploads

[](#file-uploads)

The FlexModelBundle provides support for file uploads within FlexModel forms.

To activate this support you need to complete the following steps:

#### 1. Configure the FlexModelBundle for file uploads

[](#1-configure-the-flexmodelbundle-for-file-uploads)

The bundle requires a location to store the file uploads. Configure the location with the existing FlexModelBundle configuration in your `config.yml` file:

```
# app/config/config.yml

flex_model:
    resource: "%kernel.root_dir%/../src/AppBundle/Resources/config/flexmodel.xml"
    file_upload_path: "%kernel.root_dir%/../../some-directory-outside-of-the-project/%kernel.environment%"
```

#### 2. Modify your Doctrine entity class

[](#2-modify-your-doctrine-entity-class)

To activate file uploads for a Doctrine entity you need to implement the `UploadObjectInterface` and add getters and setters for the form fields.

For ease of use the FlexModelBundle provides an `UploadTrait` to implement both the interface and the getters and setters:

```
namespace AppBundle\Entity;

use FlexModel\FlexModelBundle\Model\UploadObjectInterface;
use FlexModel\FlexModelBundle\Model\UploadTrait;

class Entity implements UploadObjectInterface
{
    use UploadTrait {
        getFileUpload as getImageUpload;
        setFileUpload as setImageUpload;
        getFileUpload as getAnotherImageUpload;
        setFileUpload as setAnotherImageUpload;
    }
}
```

In the above example you see the `UploadTrait` with getters and setters for two file upload fields implemented. Here the `getImageUpload` method maps to a FlexModel field called 'image' and `getAnotherImageUpload` maps to 'another\_image'.

Credits
-------

[](#credits)

- [Niels Nijens](https://github.com/niels-nijens)
- [All Contributors](../../contributors)

### License

[](#license)

This package is licensed under the MIT License. Please see the [LICENSE file](LICENSE.md) for details.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 81.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 ~69 days

Recently: every ~90 days

Total

10

Last Release

3074d ago

Major Versions

v0.2.0 → 1.0.02017-02-03

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3245362?v=4)[Niels Nijens](/maintainers/niels-nijens)[@niels-nijens](https://github.com/niels-nijens)

![](https://www.gravatar.com/avatar/de3977085d3fed790aa08881dcb6cb16a6ca162714a95a01ba4d99abad28f387?d=identicon)[silvano-a](/maintainers/silvano-a)

---

Top Contributors

[![niels-nijens](https://avatars.githubusercontent.com/u/3245362?v=4)](https://github.com/niels-nijens "niels-nijens (94 commits)")[![reyostallenberg](https://avatars.githubusercontent.com/u/3579090?v=4)](https://github.com/reyostallenberg "reyostallenberg (10 commits)")[![deborahvandervegt](https://avatars.githubusercontent.com/u/13642829?v=4)](https://github.com/deborahvandervegt "deborahvandervegt (9 commits)")[![silvano-a](https://avatars.githubusercontent.com/u/8051801?v=4)](https://github.com/silvano-a "silvano-a (2 commits)")

---

Tags

bundlephpsymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/flexmodel-flexmodel-bundle/health.svg)

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

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k8.7k1](/packages/kimai-kimai)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[oro/platform

Business Application Platform (BAP)

642140.7k104](/packages/oro-platform)[forumify/forumify-platform

122.0k12](/packages/forumify-forumify-platform)

PHPackages © 2026

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