PHPackages                             jbsnewmedia/ddm-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. jbsnewmedia/ddm-bundle

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

jbsnewmedia/ddm-bundle
======================

Data Definition Model Bundle for VIS

1.1.0(2mo ago)111MITPHPPHP &gt;=8.2CI passing

Since Feb 9Pushed 1mo agoCompare

[ Source](https://github.com/jbsnewmedia/ddm-bundle)[ Packagist](https://packagist.org/packages/jbsnewmedia/ddm-bundle)[ RSS](/packages/jbsnewmedia-ddm-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (4)Used By (0)

DDMBundle
=========

[](#ddmbundle)

[![Packagist Version](https://camo.githubusercontent.com/e1adc494fe534537a6fe1a88b6082a94f023bdbcbfec056fd856c418527a43d9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a62736e65776d656469612f64646d2d62756e646c65)](https://packagist.org/packages/jbsnewmedia/ddm-bundle)[![Packagist Downloads](https://camo.githubusercontent.com/5b8aef1b42f3a990eb4e65359d0b76ca500666e83f769f3b07a7d54e7e85b22b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a62736e65776d656469612f64646d2d62756e646c65)](https://packagist.org/packages/jbsnewmedia/ddm-bundle)[![PHP Version Require](https://camo.githubusercontent.com/53108867c5c6cd44d8a0ec53a8f2b0045369478440279b440aee82548517c8d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a62736e65776d656469612f64646d2d62756e646c65)](https://packagist.org/packages/jbsnewmedia/ddm-bundle)[![Symfony Version](https://camo.githubusercontent.com/ce7f7484cab9ad5373e96792620d4513e1ea50164d4c1c283a1b3a2bed55261c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d253545372e342d3637336162373f6c6f676f3d73796d666f6e79)](https://symfony.com)[![License](https://camo.githubusercontent.com/48b619fb7144c8d6caf4b7e619b6be0bb8704268ab7e587cbe7b6cdaf914af2f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6a62736e65776d656469612f64646d2d62756e646c65)](https://packagist.org/packages/jbsnewmedia/ddm-bundle)[![Tests](https://github.com/jbsnewmedia/ddm-bundle/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/jbsnewmedia/ddm-bundle/actions/workflows/tests.yml)[![PHP CS Fixer](https://camo.githubusercontent.com/056e5fa4bcf9273c04257a42b6365d1d1f431d5ea1eae0c759754f8549af2b49/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2d63732d2d66697865722d636865636b65642d627269676874677265656e)](https://github.com/jbsnewmedia/ddm-bundle/actions/workflows/tests.yml)[![PHPStan](https://camo.githubusercontent.com/26874829bb075bcbb2010c081fa8e0dda347d98fee9782e1226c47f54f56bf14/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068707374616e2d616e616c797a65642d627269676874677265656e)](https://github.com/jbsnewmedia/ddm-bundle/actions/workflows/tests.yml)[![Rector](https://camo.githubusercontent.com/e74d169a31106980ccbf6ce8ae0436dc5a603c72c76c746a156282c07dd504b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f726563746f722d636865636b65642d627269676874677265656e)](https://github.com/jbsnewmedia/ddm-bundle/actions/workflows/tests.yml)[![codecov](https://camo.githubusercontent.com/c1f16adb16257005f6b20a0e76846acc9833dbe4ec9af0146a87fae82a3ac60e/68747470733a2f2f636f6465636f762e696f2f67682f6a62736e65776d656469612f64646d2d62756e646c652f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/jbsnewmedia/ddm-bundle)

**DDMBundle** (Data Definition Model) is a Symfony bundle for the VIS ecosystem that simplifies the definition and handling of data models for datatables and forms. It provides a structured way to centrally define fields, validations, and rendering logic.

🚀 Features
----------

[](#-features)

- **Centralized Data Definition** via DDM and DDMField
- **Automated Datatable Engine** for server-side processing (sorting, searching, pagination)
- **Advanced Search Functionality** via DDMDatatableSearchHandler
- **Flexible Form Handler** for AJAX-based form processing and validation
- **Attribute-based Field Configuration** for easy integration into entities
- **Extensive Validation** (Required, String, Unique, Email, etc.)
- **Twig Integration** for easy rendering of forms and tables
- **Seamless Integration** into the VIS ecosystem

---

⚙️ Requirements
---------------

[](#️-requirements)

- PHP 8.2 or higher
- Symfony Framework 7.4 or higher
- Doctrine ORM

---

📦 Installation
--------------

[](#-installation)

Use [Composer](https://getcomposer.org/) to install the bundle:

```
composer require jbsnewmedia/ddm-bundle
```

---

🛠 Setup &amp; Configuration
---------------------------

[](#-setup--configuration)

### 1. Define Fields

[](#1-define-fields)

Fields are defined as services and can be configured with the `#[DDMFieldAttribute]` attribute to associate them with specific entities or contexts. In the `__construct` method or via initialization, field properties such as identifier, name, and behavior can be set.

```
use JBSNewMedia\DDMBundle\Attribute\DDMFieldAttribute;
use JBSNewMedia\DDMBundle\Service\DDMField;

#[DDMFieldAttribute(entity: 'User', order: 10)]
class UserNameField extends DDMField
{
    public function __construct()
    {
        $this->setIdentifier('username');
        $this->setName('Username');
        $this->setSortable(true);
        $this->setLivesearch(true);
    }
}
```

### 2. Create DDM Instance

[](#2-create-ddm-instance)

Use the `DDMFactory` to create a DDM instance for an entity and a context:

```
use JBSNewMedia\DDMBundle\Service\DDMFactory;

public function index(DDMFactory $ddmFactory)
{
    $ddm = $ddmFactory->create(User::class, 'admin_list');
    // ...
}
```

---

📋 Usage Examples
----------------

[](#-usage-examples)

### Using Datatable in a Controller

[](#using-datatable-in-a-controller)

The `DDMDatatableEngine` handles all the logic for providing the data:

```
use JBSNewMedia\DDMBundle\Service\DDMDatatableEngine;
use JBSNewMedia\DDMBundle\Service\DDMFactory;
use Symfony\Component\HttpFoundation\Request;

public function list(Request $request, DDMFactory $ddmFactory, DDMDatatableEngine $engine)
{
    $ddm = $ddmFactory->create(User::class, 'list');

    if ($request->isXmlHttpRequest()) {
        return $engine->handleRequest($request, $ddm);
    }

    return $this->render('user/list.html.twig', [
        'ddm' => $ddm
    ]);
}
```

### Processing a Form

[](#processing-a-form)

The `DDMDatatableFormHandler` automates loading, validating, and saving entities. It returns either a rendered form or a JSON response.

```
use JBSNewMedia\DDMBundle\Service\DDMDatatableFormHandler;
use Symfony\Component\HttpFoundation\Response;

public function edit(Request $request, User $user, DDMDatatableFormHandler $formHandler)
{
    $ddm = $this->ddmFactory->create(User::class, 'edit');

    $response = $formHandler->handle($request, $ddm, $user);

    return $response;
}
```

---

🎨 Template Integration
----------------------

[](#-template-integration)

### Datatable Rendering

[](#datatable-rendering)

```

```

---

📁 Architecture Overview
-----------------------

[](#-architecture-overview)

### Core Components

[](#core-components)

```
src/
├── Attribute/           # PHP Attributes for field configuration
├── Contract/            # Interfaces for fields, validators and values
├── DependencyInjection/ # Bundle configuration & extension
├── Doctrine/            # Doctrine-specific extensions (e.g. CAST function)
├── Service/
│   ├── DDM.php              # Central model of a data definition
│   ├── DDMFactory.php       # Factory for creating DDM instances
│   ├── DDMField.php         # Base class for all fields
│   ├── DDMDatatableEngine.php # Engine for datatable requests
│   ├── DDMDatatableFormHandler.php # Handler for form logic
│   └── DDMDatatableSearchHandler.php # Handler for datatable search
├── Trait/               # Shared functionalities (e.g. entity access)
├── Validator/           # Validators (Required, String, Unique, Email, etc.)
├── Value/               # Value objects (String, Array, etc.)
└── DDMBundle.php        # Bundle class

```

---

🧪 Developer Tools
-----------------

[](#-developer-tools)

The following commands are available for development:

```
# Tool installation
composer bin-ecs-install
composer bin-phpstan-install
composer bin-phpunit-install
composer bin-rector-install

# Code quality checks
composer bin-ecs           # PHP-CS-Fixer check
composer bin-phpstan       # Static analysis
composer bin-rector        # Code transformation (dry-run)
composer test              # PHPUnit tests

# Automatic fixes
composer bin-ecs-fix       # Fix coding standards
composer bin-rector-process # Apply code transformation

# CI Pipelines
composer ci                # Execute all checks
```

---

📜 License
---------

[](#-license)

This bundle is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.

Developed by Jürgen Schwind and other contributors.

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! If you would like to contribute, please create a pull request or open an issue.

---

📫 Contact
---------

[](#-contact)

If you have questions or problems, please open an issue in our [GitHub repository](https://github.com/jbsnewmedia/ddm-bundle).

---

*Data Definition Model. Modular. Efficient. VIS-Ready.*

###  Health Score

41

—

FairBetter than 88% of packages

Maintenance93

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Every ~10 days

Total

2

Last Release

77d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44b85e5ce069ccae08123600bb24204ea8fe99c8cb5cbfae108ff29c179e503d?d=identicon)[jschwind](/maintainers/jschwind)

---

Top Contributors

[![jschwind](https://avatars.githubusercontent.com/u/985564?v=4)](https://github.com/jschwind "jschwind (36 commits)")

---

Tags

data-definition-modeldoctrinedoctrine-ormsymfonysymfony-bundlesymfony7

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[sulu/sulu

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

1.3k1.3M151](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)

PHPackages © 2026

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