From 18c3db6b020483fa1b600f9aa1e06c1419e1bbe2 Mon Sep 17 00:00:00 2001 From: RobinDev Date: Thu, 21 Mar 2024 09:11:18 +0100 Subject: [PATCH] wip : multiple configuration for orm 3 or ORM 2 --- docs/reference/installation.rst | 1 + src/Entity/BaseUser3.php | 18 +++++++++++++++ .../config/doctrine/BaseUser.orm.xml | 2 +- .../config/doctrine/BaseUser.orm3.xml | 22 +++++++++++++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 src/Entity/BaseUser3.php create mode 100644 src/Resources/config/doctrine/BaseUser.orm3.xml diff --git a/docs/reference/installation.rst b/docs/reference/installation.rst index f43353c4c..f318a65a8 100644 --- a/docs/reference/installation.rst +++ b/docs/reference/installation.rst @@ -82,6 +82,7 @@ And then create the corresponding entity, ``src/Entity/SonataUserUser``:: use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Sonata\UserBundle\Entity\BaseUser; + // or `Sonata\UserBundle\Entity\BaseUser3` as BaseUser if you upgrade to doctrine/orm ^3 #[ORM\Entity] #[ORM\Table(name: 'user__user')] diff --git a/src/Entity/BaseUser3.php b/src/Entity/BaseUser3.php new file mode 100644 index 000000000..042350969 --- /dev/null +++ b/src/Entity/BaseUser3.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\UserBundle\Entity; + +class BaseUser3 extends BaseUser +{ +} diff --git a/src/Resources/config/doctrine/BaseUser.orm.xml b/src/Resources/config/doctrine/BaseUser.orm.xml index 11d5ec41f..92ae3d230 100644 --- a/src/Resources/config/doctrine/BaseUser.orm.xml +++ b/src/Resources/config/doctrine/BaseUser.orm.xml @@ -11,7 +11,7 @@ - + diff --git a/src/Resources/config/doctrine/BaseUser.orm3.xml b/src/Resources/config/doctrine/BaseUser.orm3.xml new file mode 100644 index 000000000..6ebf323c6 --- /dev/null +++ b/src/Resources/config/doctrine/BaseUser.orm3.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + +