DDC-1412: DriverChain defaultDriver #1769

Closed
opened 2026-01-22 13:25:08 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 11, 2011).

Jira issue originally created by user armetiz:

The \Doctrine\ORM\Mapping\Driver\DriverChain is a good thing, but a default driver should be a another great thing.

Actually, to use DoctrineExtension Translatable I have to use the DriveChain to add a specific driver for Gedmo\Translatable.
The problem is, that I have to define the same EntityDriver on all my entity in this driver.

$driverChain->addDriver ($entityDriver, 'EntityA');
...
$driverChain->addDriver ($entityDriver, 'EntityB');
$driverChain->addDriver ($translatableDriver, 'Gedmo\Translatable');

It would be really friendly to do
$driverChain->setDefaultDriver ($entityDriver);
$driverChain->addDriver ($translatableDriver, 'Gedmo\Translatable');

I have attach a fix (SVN) for the DriveChain class.

Originally created by @doctrinebot on GitHub (Oct 11, 2011). Jira issue originally created by user armetiz: The \Doctrine\ORM\Mapping\Driver\DriverChain is a good thing, but a default driver should be a another great thing. Actually, to use DoctrineExtension Translatable I have to use the DriveChain to add a specific driver for Gedmo\Translatable. The problem is, that I have to define the same EntityDriver on all my entity in this driver. $driverChain->addDriver ($entityDriver, 'EntityA'); ... $driverChain->addDriver ($entityDriver, 'EntityB'); $driverChain->addDriver ($translatableDriver, 'Gedmo\Translatable'); It would be really friendly to do $driverChain->setDefaultDriver ($entityDriver); $driverChain->addDriver ($translatableDriver, 'Gedmo\Translatable'); I have attach a fix (SVN) for the DriveChain class.
admin added the New Feature label 2026-01-22 13:25:08 +01:00
admin closed this issue 2026-01-22 13:25:09 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 28, 2012):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jan 28, 2012): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Jan 29, 2012):

Comment created by @FabioBatSilva:

Fixed in : 16b22f0f31

@doctrinebot commented on GitHub (Jan 29, 2012): Comment created by @FabioBatSilva: Fixed in : https://github.com/doctrine/doctrine2/commit/16b22f0f3138ad607ccecd9397d0ec267d6cc478
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 1 attachments from Jira into https://gist.github.com/0009211af4aa695c99ce

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 1 attachments from Jira into https://gist.github.com/0009211af4aa695c99ce - [11071_driverchain.patch](https://gist.github.com/0009211af4aa695c99ce#file-11071_driverchain-patch)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1769