PHPackages                             netpositive/discriminatormap-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. netpositive/discriminatormap-bundle

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

netpositive/discriminatormap-bundle
===================================

Dynamic DiscriminatorMap extender for Symfony2 with Doctrine ORM 2

v2.2.1(13y ago)1411.4k2[1 PRs](https://github.com/Netpositive/NetpositiveDiscriminatorMapBundle/pulls)MITPHPPHP &gt;=5.3.1

Since Dec 9Pushed 8y ago9 watchersCompare

[ Source](https://github.com/Netpositive/NetpositiveDiscriminatorMapBundle)[ Packagist](https://packagist.org/packages/netpositive/discriminatormap-bundle)[ Docs](https://github.com/Netpositive/NetpositiveDiscriminatorMapBundle)[ RSS](/packages/netpositive-discriminatormap-bundle/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (7)Used By (0)

Provides the possibility to extend DiscriminatorMap on an Inheritance Mapped class with Class Table Inheritance in Symfony2 with [Doctrine ORM 2](http://docs.doctrine-project.org/projects/doctrine-orm/en/2.1/reference/inheritance-mapping.html#class-table-inheritance).

This bundle was intended to extend an existing DiscriminatorMap (comes from any mapping) through the config file, if you can't do it by hand (ie: the bundle you want to extend is developed outside your project).

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

[](#installation)

### 1, Using composer

[](#1-using-composer)

#### 1.1 Add netpositive/discriminatormapbundle to your composer.json

[](#11-add-netpositivediscriminatormapbundle-to-your-composerjson)

```
// composer.json
{
"require": {
    ...
    "netpositive/discriminatormap-bundle": "dev-master"

```

#### 1.2 Enable it at your kernel

[](#12-enable-it-at-your-kernel)

```
// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Netpositive\DiscriminatorMapBundle\NetpositiveDiscriminatorMapBundle(),

```

### 2, Using vendors

[](#2-using-vendors)

#### 2.1 Add to the deps file

[](#21-add-to-the-deps-file)

```
[NetpositiveDiscriminatorMapBundle]
    git=git://github.com/Netpositive/NetpositiveDiscriminatorMapBundle.git
    target=bundles/Netpositive/DiscriminatorMapBundle

```

#### 2.2 Register the namespace in your autoload.php

[](#22-register-the-namespace-in-your-autoloadphp)

```
// app/autoload.php
$loader->registerNamespaces(array(
    ...
    'Netpositive'      => __DIR__.'/../vendor/bundles',

```

#### 2.3 Enable it at your kernel

[](#23-enable-it-at-your-kernel)

```
// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Netpositive\DiscriminatorMapBundle\NetpositiveDiscriminatorMapBundle(),

```

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

[](#configuration)

```
# app/config/config.yml
netpositive_discriminator_map:
    discriminator_map:
        content:
            entity: Netpositive\CmsBundle\Entity\Content
            children:
                course: University\CmsBundle\Entity\Content\Course
                phonebook_entry: University\CmsBundle\Entity\Content\PhonebookEntry
                ...

```

### Parent class:

[](#parent-class)

```
/**
 * Netpositive\CmsBundle\Entity\Content
 *
 * @ORM\Table(name="content")
 * @ORM\Entity()
 * @ORM\InheritanceType("JOINED")
 * @ORM\DiscriminatorColumn(name="content_type", type="string", length="20")
 * @ORM\DiscriminatorMap({"content" = "Content", "article" = "Article", ... })
 *
 */
class Content
{
...

```

### children classes:

[](#children-classes)

```
/**
 * University\CmsBundle\Entity\Content\Course
 *
 * @ORM\Table(name="course")
 * @ORM\Entity()
 */
class Course extends Content
{
...

/**
 * University\CmsBundle\Entity\Content\PhonebookEntry
 *
 * @ORM\Table(name="phonebook_entry")
 * @ORM\Entity()
 */
class PhonebookEntry extends Content
{
...

```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

6

Last Release

4862d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/864531?v=4)[Peter Buri](/maintainers/burci)[@burci](https://github.com/burci)

---

Top Contributors

[![aswyx](https://avatars.githubusercontent.com/u/1587113?v=4)](https://github.com/aswyx "aswyx (9 commits)")[![Padam87](https://avatars.githubusercontent.com/u/776488?v=4)](https://github.com/Padam87 "Padam87 (6 commits)")[![burci](https://avatars.githubusercontent.com/u/864531?v=4)](https://github.com/burci "burci (4 commits)")[![smatyas](https://avatars.githubusercontent.com/u/534550?v=4)](https://github.com/smatyas "smatyas (4 commits)")[![drthief](https://avatars.githubusercontent.com/u/243979?v=4)](https://github.com/drthief "drthief (3 commits)")

---

Tags

doctrinesingle-table-inheritancediscriminator map

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/netpositive-discriminatormap-bundle/health.svg)](https://phpackages.com/packages/netpositive-discriminatormap-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)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[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)[sylius/resource

Basic resource interfaces for PHP applications.

252.8M101](/packages/sylius-resource)

PHPackages © 2026

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