hopeter1018 / doctrine-discriminator-map-bundle
This bundle simplify doctrine discriminator map config
1.0.2
2020-07-09 08:03 UTC
Requires
- php: >=5.5.9
This package is auto-updated.
Last update: 2025-03-29 00:48:59 UTC
README
Introduction
This bundle aims to simplify doctrine discriminator map config.
By adding ONLY one annotation to parent and EACH children, the bundle:
- handle the
* @ORM\\*
annotation - add a Database index
Installation
Require the package
composer require hopeter1018/doctrine-discriminator-map-bundle
Add to kernel
Symfony 4+ or Symfony Flex
Add /config/bundles.php
return [ ..., HoPeter1018\DoctrineDiscriminatorMapBundle\HoPeter1018DoctrineDiscriminatorMapBundle::class => ['all' => true], ];
Symfony 2+
Add /app/AppKernel.php
$bundles = [ ..., new HoPeter1018\DoctrineDiscriminatorMapBundle\HoPeter1018DoctrineDiscriminatorMapBundle(), ];
Config
thru Doctrine Annotation (Parent + ALL children)
Parent
namespace Your\Bundle\Entity; use HoPeter1018\DoctrineDiscriminatorMapBundle\Annotation\DiscriminatorParent; /** * Class docblock * * @DiscriminatorParent */ class ParentEntityClass { }
All Children
namespace Your\Bundle\Entity; use HoPeter1018\DoctrineDiscriminatorMapBundle\Annotation\DiscriminatorParent; /** * Class docblock * * @DiscriminatorEntry */ class EntryEntityClass { }