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 1mo ago

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 80% 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

4806d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/180fe1c90b01fd23f7519573144e38cccb2beb30f8201f125e792f88fe839adb?d=identicon)[burci](/maintainers/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

[knplabs/doctrine-behaviors

Doctrine Behavior Traits

92212.7M64](/packages/knplabs-doctrine-behaviors)[sonata-project/doctrine-orm-admin-bundle

Integrate Doctrine ORM into the SonataAdminBundle

46117.7M155](/packages/sonata-project-doctrine-orm-admin-bundle)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)[sylius/grid-bundle

Amazing grids with support of filters and custom fields integrated into Symfony.

1358.3M44](/packages/sylius-grid-bundle)[omines/datatables-bundle

Symfony DataTables Bundle with native Doctrine ORM, Elastica and MongoDB support

2851.4M6](/packages/omines-datatables-bundle)[data-dog/audit-bundle

Audit bundle for symfony2 and doctrine orm, logs any database change

141901.7k1](/packages/data-dog-audit-bundle)

PHPackages © 2026

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