2017 © Pedro Peláez
 

symfony-bundle discriminator-map-bundle

Dynamic DiscriminatorMap extender for Symfony with Doctrine ORM

image

paneedesign/discriminator-map-bundle

Dynamic DiscriminatorMap extender for Symfony with Doctrine ORM

  • Monday, December 4, 2017
  • by pane-e-design
  • Repository
  • 3 Watchers
  • 0 Stars
  • 129 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 37 % Grown

The README.md

Welcome to Discriminator Map Bundle 👋

Version Documentation Twitter: dr_thief , (*1)

Dynamic DiscriminatorMap extender for Symfony with Doctrine ORM., (*2)

🏠 Homepage

Installation

Step 1: Download the Bundle

Install via Composer:, (*3)

composer require paneedesign/discriminator-map-bundle

Or add this to your composer.json and run composer update:, (*4)

"require": {
    "paneedesign/discriminator-map-bundle": "^1.0"
}

This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation., (*5)

Step 2: Enable the Bundle

Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php file of your project:, (*6)

<?php
// app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new \PaneeDesign\DiscriminatorMapBundle\PedDiscriminatorMapBundle(),
        );

        // ...
    }

    // ...
}

Step 3: Configurations

Add configuration:, (*7)

// app/config/config.yml
//...
ped_discriminator_map:
    maps:
        user:
            entity: PaneeDesign\UserBundle\Entity\User
            children:
                admin:    AppBundle\Entity\Admin
                owner:    AppBundle\Entity\Owner
                customer: AppBundle\Entity\Customer
                ...

where parent class implement this annotations:, (*8)

/**
 * @ORM\Entity()
 * @ORM\Table(name="user")
 * @ORM\InheritanceType("JOINED")
 * @ORM\DiscriminatorColumn(name="user_grant", type="string", length="10")
 * @ORM\DiscriminatorMap({"user" = "User"})
 */
abstract class User
{
    ...
}

and children class these one:, (*9)

/**
 * Class Admin
 *
 * @package AppBundle\Entity
 * @ORM\Entity
 * @ORM\Table(name="user_admin")
 */
class Admin extends User
{
    ...
}
/**
 * Class Owner
 *
 * @package AppBundle\Entity
 * @ORM\Entity()
 * @ORM\Table(name="user_owner")
 */
class Owner
{
    ...
}
/**
 * Class Customer
 *
 * @package AppBundle\Entity
 * @ORM\Entity()
 * @ORM\Table(name="user_customer")
 */
class Customer
{
    ...
}

Author

👤 Fabiano Roberto, (*10)

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page., (*11)

Show your support

Give a ⭐️ if this project helped you!, (*12)


This README was generated with ❤️ by readme-md-generator, (*13)

The Versions

04/12 2017

dev-master

9999999-dev http://www.paneedesign.com/

Dynamic DiscriminatorMap extender for Symfony with Doctrine ORM

  Sources   Download

MIT

The Requires

 

by Fabiano Roberto

orm php bundle doctrine symfony discriminator

04/12 2017

v1.0.2

1.0.2.0 http://www.paneedesign.com/

Dynamic DiscriminatorMap extender for Symfony with Doctrine ORM

  Sources   Download

MIT

The Requires

 

by Fabiano Roberto

orm php bundle doctrine symfony discriminator