PHPackages                             jonathanlight/meta-entity-builder-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. jonathanlight/meta-entity-builder-bundle

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

jonathanlight/meta-entity-builder-bundle
========================================

Symfony bundle that generates Doctrine entities from YAML schemas with smart update detection, custom code preservation, and automatic backups

v1.1.2(2mo ago)06Apache-2.0PHPPHP &gt;=7.4

Since Feb 10Pushed 2mo agoCompare

[ Source](https://github.com/Jonathanlight/meta_entity_builder_bundle)[ Packagist](https://packagist.org/packages/jonathanlight/meta-entity-builder-bundle)[ RSS](/packages/jonathanlight-meta-entity-builder-bundle/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (1)Dependencies (24)Versions (8)Used By (0)

MetaEntityBuilderBundle
=======================

[](#metaentitybuilderbundle)

A Symfony bundle that generates Doctrine entities from YAML schemas with smart update detection, custom code preservation, and automatic backups.

Features
--------

[](#features)

- **YAML-based schema definition** — Define your entities in a clean YAML format
- **Smart update detection** — Only regenerates entities when the schema changes (MD5 checksums)
- **Custom code preservation** — Code between `// @custom-code-start` and `// @custom-code-end` markers is preserved across regeneration
- **Automatic backups** — Timestamped backups before any file is overwritten
- **PHP 8 attributes** — Generated entities use modern Doctrine ORM attributes (`#[ORM\Entity]`, `#[ORM\Column]`, etc.)
- **Fluent setters** — All setters return `$this` for method chaining
- **Collection helpers** — Automatic `add*`/`remove*` methods for `*ToMany` relations
- **Event-driven** — Dispatches events on entity generation and update

Requirements
------------

[](#requirements)

- PHP 7.4+
- Symfony 5.4 | 6.x | 7.x
- Doctrine ORM 2.10+ | 3.x

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

[](#installation)

```
composer require jonathanlight/meta-entity-builder-bundle
```

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

[](#configuration)

```
# config/packages/meta_entity_builder.yaml
meta_entity_builder:
    schema_path: '%kernel.project_dir%/config/entities.yaml'
    entity_namespace: 'App\Entity'
    entity_directory: '%kernel.project_dir%/src/Entity'
    backup_enabled: true
    backup_directory: '%kernel.project_dir%/var/backups/entities'
    generate_repository: true
    repository_namespace: 'App\Repository'
    strict_mode: true
```

Schema Definition
-----------------

[](#schema-definition)

Create your entity definitions in YAML:

```
# config/entities.yaml
entities:
    User:
        table: users
        repository: App\Repository\UserRepository
        properties:
            id:
                type: integer
                id: true
                autoIncrement: true
            email:
                type: string
                length: 180
                unique: true
            name:
                type: string
                length: 255
            createdAt:
                type: datetime_immutable
        relations:
            posts:
                type: OneToMany
                targetEntity: Post
                mappedBy: author
                cascade: [persist, remove]
                orphanRemoval: true
        indexes:
            idx_email: [email]

    Post:
        table: posts
        properties:
            id:
                type: integer
                id: true
                autoIncrement: true
            title:
                type: string
                length: 255
            content:
                type: text
                nullable: true
            published:
                type: boolean
                default: false
        relations:
            author:
                type: ManyToOne
                targetEntity: User
                inversedBy: posts
                joinColumn:
                    name: author_id
                    referencedColumnName: id
```

Usage
-----

[](#usage)

### Generate entities

[](#generate-entities)

```
# Generate all entities
php bin/console meta-generate:entity

# Dry run (preview changes without writing files)
php bin/console meta-generate:entity --dry-run

# Force regeneration (ignore checksums)
php bin/console meta-generate:entity --force

# Generate a specific entity
php bin/console meta-generate:entity --entity=User
```

Aliases available: `meta:entity:generate`, `entity:generate`

### Custom Code Preservation

[](#custom-code-preservation)

Generated entities include markers where you can add custom code:

```
class User
{
    // ... generated properties and methods ...

    // @custom-code-start
    // Add your custom methods here — this block is preserved on regeneration
    public function getFullName(): string
    {
        return $this->firstName . ' ' . $this->lastName;
    }
    // @custom-code-end
}
```

Events
------

[](#events)

The bundle dispatches the following events:

- `Meta\EntityBuilderBundle\Event\EntityGeneratedEvent` — When a new entity is created
- `Meta\EntityBuilderBundle\Event\EntityUpdatedEvent` — When an existing entity is updated

License
-------

[](#license)

Apache License 2.0 — see [LICENSE](LICENSE) for details.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance85

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 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 ~5 days

Total

5

Last Release

76d ago

Major Versions

v0.1.0 → v1.0.02026-02-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/6aa5062dc3c8c4903f6942ed953ed5defb965579ca92985ad16f9758057569de?d=identicon)[jonathankablan](/maintainers/jonathankablan)

---

Top Contributors

[![Jonathanlight](https://avatars.githubusercontent.com/u/14360142?v=4)](https://github.com/Jonathanlight "Jonathanlight (15 commits)")

---

Tags

symfonyschemayamlgeneratordoctrineentity

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jonathanlight-meta-entity-builder-bundle/health.svg)

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

###  Alternatives

[sylius/sylius

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

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

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

1.3k1.3M152](/packages/sulu-sulu)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k16.7M310](/packages/easycorp-easyadmin-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)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)

PHPackages © 2026

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