PHPackages                             dualmedia/disable-orm-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. dualmedia/disable-orm-bundle

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

dualmedia/disable-orm-bundle
============================

Bundle for disabling fields in DoctrineORM

1.1.1(1mo ago)0359↑32.1%[1 issues](https://github.com/dualmediaspzoo/disable-orm-bundle/issues)MITPHPPHP ^8.3

Since Sep 19Pushed 1mo agoCompare

[ Source](https://github.com/dualmediaspzoo/disable-orm-bundle)[ Packagist](https://packagist.org/packages/dualmedia/disable-orm-bundle)[ RSS](/packages/dualmedia-disable-orm-bundle/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)Dependencies (41)Versions (12)Used By (0)

[![Packagist Downloads](https://camo.githubusercontent.com/f587bee1afe3abffd28dc4a726cadab948509b1bf1bd6b0e2db203752de3b4e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6475616c6d656469612f64697361626c652d6f726d2d62756e646c65)](https://packagist.org/packages/dualmedia/disable-orm-bundle)

DisableORM Bundle
=================

[](#disableorm-bundle)

A Symfony + Doctrine bundle to allow disabling fields from being seen by DoctrineORM.

Why
---

[](#why)

This bundle will allow you to seamlessly update your application, assuming you have multiple versions running at the same time, with different database expectations.

While adding new entities is not an issue, as they're simply not present in the old application versions, this is not the case for entities being modified. You must either shut down all instances before running migrations which could cause differences in database schema expectations or... use this bundle.

With this, you're able to safely "remove" a field, so that the old version of the application can still use it before update, and the new one can ignore it.

> As this modifies the ORM metadata the field is transparently removed from ORM and is not usable outside of raw SQL queries.

Install
-------

[](#install)

Simply `composer require dualmedia/disable-orm-bundle`

Then add the bundle to your `config/bundles.php` file like so

```
return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    // other bundles ...
    DualMedia\DisableORMBundle\DisableORMBundle::class => ['all' => true],
];
```

Setup
-----

[](#setup)

You must manually set the doctrine class metadata factory name value under your entity manager to use this bundle.

```
doctrine:
  orm:
    entity_managers:
      :
        class_metadata_factory_name: DualMedia\DisableORMBundle\Factory
```

Config
------

[](#config)

```
dm_disable_orm:
  # you can specify commands which should not be affected by DisableORM logic
  # defaults are below, you don't need to modify them unless you want to
  disable_on_commands:
    - 'doctrine:schema:validate'
    - 'doctrine:migrations:diff'
```

Usage
-----

[](#usage)

The `#[DisableORM]` attribute prevents doctrine from loading and creating the column from the database.

> You should set a default value for the column before this, as otherwise you might get issues inserting new entities!

Use your entities as usual, when you decide you want to remove a field from it simply add `#[DisableORM]` on it, then update your application once.

From then, you can safely remove the field with a migration while not causing any downtime.

Example
-------

[](#example)

```
#[ORM\Entity]
class FooEntity {
    #[ORM\Column]
    public int|null $normalField = null;

    #[DisableORM]
    #[ORM\Column(options: ['default' => false])]
    public int|null $someField = null;

    // ... getters and setters, etc.
}
```

PHPStan Rule
------------

[](#phpstan-rule)

Simply add the following to your PHPStan config to enable a simple check for your entities (only applies if you're using PHP8 Attributes)

```
includes:
  - vendor/dualmedia/disable-orm-bundle/extension.neon
```

Git change detection
--------------------

[](#git-change-detection)

To prevent breaking your application on accident you may add the script in /scripts to your CI to automatically detect possibly incorrect removals of fields.

As when using this bundle it is expected, that a removed field WILL contain the DisableORM attribute, before being deleted, because of that, we can catch invalid field removals in the CI steps.

A Gitlab CI declaration is provided in the .gitlab-ci.job.yml file, simply include it and then extend it as required.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance92

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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

Recently: every ~47 days

Total

8

Last Release

38d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0642c17604cd51622ad504c999eb75ba78e5768bfa998eaa2922366fc90f0302?d=identicon)[pkly](/maintainers/pkly)

---

Top Contributors

[![pkly](https://avatars.githubusercontent.com/u/17160364?v=4)](https://github.com/pkly "pkly (20 commits)")

---

Tags

doctrinephpsymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dualmedia-disable-orm-bundle/health.svg)

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

###  Alternatives

[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.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

9410.8k](/packages/ahmed-bhs-doctrine-doctor)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

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