do not choke on not existing mapping field

This commit is contained in:
Christian Flothmann 2019-05-01 07:27:43 +02:00
parent 1c110fa1f7
commit 9a9134f4e4
3 changed files with 4 additions and 1 deletions

View File

@ -17,6 +17,8 @@ class BaseUser
*/
private $username;
private $enabled;
/**
* BaseUser constructor.
*

View File

@ -6,6 +6,7 @@
<mapped-superclass name="Symfony\Bridge\Doctrine\Tests\Fixtures\BaseUser">
<field name="username" column="username" type="string" length="120" />
<field name="enabled" type="boolean" />
</mapped-superclass>
</doctrine-mapping>

View File

@ -72,7 +72,7 @@ final class DoctrineLoader implements LoaderInterface
$metadata->addConstraint(new UniqueEntity(['fields' => $mapping['fieldName']]));
}
if (null === $mapping['length']) {
if (null === ($mapping['length'] ?? null)) {
continue;
}