1
0
mirror of synced 2025-02-09 00:39:25 +03:00

Fix remaining usages of deprecated ClassLoader and Inflector from doctrine/common

This commit is contained in:
Michael Moravec 2018-07-13 05:31:39 +02:00
parent 43d308116d
commit f4b775323d
No known key found for this signature in database
GPG Key ID: 946F139F96C1C1B5
3 changed files with 7 additions and 4 deletions

View File

@ -27,7 +27,6 @@ use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use ReflectionClass;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\Common\ClassLoader;
use Doctrine\ORM\Cache\CacheException;
/**
@ -1025,7 +1024,11 @@ class ClassMetadataInfo implements ClassMetadata
public function validateAssociations()
{
foreach ($this->associationMappings as $mapping) {
if ( ! ClassLoader::classExists($mapping['targetEntity']) ) {
if (
! class_exists($mapping['targetEntity'])
&& ! interface_exists($mapping['targetEntity'])
&& ! trait_exists($mapping['targetEntity'])
) {
throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']);
}
}

View File

@ -20,7 +20,7 @@
namespace Doctrine\ORM\Tools;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\Common\Util\Inflector;
use Doctrine\Common\Inflector\Inflector;
use Doctrine\DBAL\Types\Type;
use Symfony\Component\Yaml\Yaml;

View File

@ -20,7 +20,7 @@
namespace Doctrine\ORM\Tools;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Util\Inflector;
use Doctrine\Common\Inflector\Inflector;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Mapping\ClassMetadataInfo;