Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine Adoption Laravel Package

benkle/doctrine-adoption

Adds a small Collector + Doctrine metadata listener to enhance inheritance mapping by “adopting” child entities into a parent with a named association. Register the loadClassMetadata listener manually (including for schema creation/CLI tools).

View on GitHub
Deep Wiki
Context7

doctrine-adoption

A small set of classes to make doctrines inheritance mapping more useful. If you want to use this in Symfony you should take the benkle/doctrine-adoption-bundle instead.

Installation

composer require benkle/doctrine-adoption

Usage

<?php
$collector = new Benkle\DoctrineAdoption\Collector();

$collector->addAdoptee(ParentEntity::class, ChildEntity::class, 'child');

$eventManager = new EventManager();
$eventManager->addEventListener([Events::loadClassMetadata], new Benkle\DoctrineAdoption\MetadataListener($collector));

$entityManager = EntityManager::create($dbOpts, $config, $eventManager);

Please note:

  • The listener is never added automatically, so you'll have to create your own version of the doctrine executable for the table creation to work properly.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed