Cache
9 months ago
Decorator
9 months ago
Event
9 months ago
Exception
9 months ago
Id
9 months ago
Internal
9 months ago
Mapping
9 months ago
Persisters
8 months ago
Proxy
9 months ago
Query
9 months ago
Repository
9 months ago
Tools
9 months ago
Utility
9 months ago
AbstractQuery.php
9 months ago
Cache.php
9 months ago
Configuration.php
9 months ago
EntityManager.php
9 months ago
EntityManagerInterface.php
9 months ago
EntityNotFoundException.php
9 months ago
EntityRepository.php
9 months ago
Events.php
9 months ago
LazyCriteriaCollection.php
9 months ago
NativeQuery.php
9 months ago
NoResultException.php
9 months ago
NonUniqueResultException.php
9 months ago
ORMException.php
9 months ago
ORMInvalidArgumentException.php
9 months ago
ORMSetup.php
9 months ago
OptimisticLockException.php
9 months ago
PersistentCollection.php
9 months ago
PessimisticLockException.php
9 months ago
Query.php
9 months ago
QueryBuilder.php
9 months ago
TransactionRequiredException.php
9 months ago
UnexpectedResultException.php
9 months ago
UnitOfWork.php
9 months ago
Version.php
9 months ago
index.php
9 months ago
ORMException.php
130 lines
| 1 | <?php |
| 2 | declare (strict_types=1); |
| 3 | namespace MailPoetVendor\Doctrine\ORM; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | use MailPoetVendor\Doctrine\Common\Cache\Cache as CacheDriver; |
| 6 | use MailPoetVendor\Doctrine\ORM\Cache\Exception\InvalidResultCacheDriver; |
| 7 | use MailPoetVendor\Doctrine\ORM\Cache\Exception\MetadataCacheNotConfigured; |
| 8 | use MailPoetVendor\Doctrine\ORM\Cache\Exception\MetadataCacheUsesNonPersistentCache; |
| 9 | use MailPoetVendor\Doctrine\ORM\Cache\Exception\QueryCacheNotConfigured; |
| 10 | use MailPoetVendor\Doctrine\ORM\Cache\Exception\QueryCacheUsesNonPersistentCache; |
| 11 | use MailPoetVendor\Doctrine\ORM\Exception\EntityManagerClosed; |
| 12 | use MailPoetVendor\Doctrine\ORM\Exception\InvalidEntityRepository; |
| 13 | use MailPoetVendor\Doctrine\ORM\Exception\InvalidHydrationMode; |
| 14 | use MailPoetVendor\Doctrine\ORM\Exception\MismatchedEventManager; |
| 15 | use MailPoetVendor\Doctrine\ORM\Exception\MissingIdentifierField; |
| 16 | use MailPoetVendor\Doctrine\ORM\Exception\MissingMappingDriverImplementation; |
| 17 | use MailPoetVendor\Doctrine\ORM\Exception\NamedNativeQueryNotFound; |
| 18 | use MailPoetVendor\Doctrine\ORM\Exception\NamedQueryNotFound; |
| 19 | use MailPoetVendor\Doctrine\ORM\Exception\ProxyClassesAlwaysRegenerating; |
| 20 | use MailPoetVendor\Doctrine\ORM\Exception\UnexpectedAssociationValue; |
| 21 | use MailPoetVendor\Doctrine\ORM\Exception\UnknownEntityNamespace; |
| 22 | use MailPoetVendor\Doctrine\ORM\Exception\UnrecognizedIdentifierFields; |
| 23 | use MailPoetVendor\Doctrine\ORM\Persisters\Exception\CantUseInOperatorOnCompositeKeys; |
| 24 | use MailPoetVendor\Doctrine\ORM\Persisters\Exception\InvalidOrientation; |
| 25 | use MailPoetVendor\Doctrine\ORM\Persisters\Exception\UnrecognizedField; |
| 26 | use MailPoetVendor\Doctrine\ORM\Repository\Exception\InvalidFindByCall; |
| 27 | use MailPoetVendor\Doctrine\ORM\Repository\Exception\InvalidMagicMethodCall; |
| 28 | use MailPoetVendor\Doctrine\ORM\Tools\Exception\NotSupported; |
| 29 | use Exception; |
| 30 | use function sprintf; |
| 31 | class ORMException extends Exception |
| 32 | { |
| 33 | public static function missingMappingDriverImpl() |
| 34 | { |
| 35 | return MissingMappingDriverImplementation::create(); |
| 36 | } |
| 37 | public static function namedQueryNotFound($queryName) |
| 38 | { |
| 39 | return NamedQueryNotFound::fromName($queryName); |
| 40 | } |
| 41 | public static function namedNativeQueryNotFound($nativeQueryName) |
| 42 | { |
| 43 | return NamedNativeQueryNotFound::fromName($nativeQueryName); |
| 44 | } |
| 45 | public static function unrecognizedField($field) |
| 46 | { |
| 47 | return new UnrecognizedField(sprintf('Unrecognized field: %s', $field)); |
| 48 | } |
| 49 | public static function unexpectedAssociationValue($class, $association, $given, $expected) |
| 50 | { |
| 51 | return UnexpectedAssociationValue::create($class, $association, $given, $expected); |
| 52 | } |
| 53 | public static function invalidOrientation($className, $field) |
| 54 | { |
| 55 | return InvalidOrientation::fromClassNameAndField($className, $field); |
| 56 | } |
| 57 | public static function entityManagerClosed() |
| 58 | { |
| 59 | return EntityManagerClosed::create(); |
| 60 | } |
| 61 | public static function invalidHydrationMode($mode) |
| 62 | { |
| 63 | return InvalidHydrationMode::fromMode($mode); |
| 64 | } |
| 65 | public static function mismatchedEventManager() |
| 66 | { |
| 67 | return MismatchedEventManager::create(); |
| 68 | } |
| 69 | public static function findByRequiresParameter($methodName) |
| 70 | { |
| 71 | return InvalidMagicMethodCall::onMissingParameter($methodName); |
| 72 | } |
| 73 | public static function invalidMagicCall($entityName, $fieldName, $method) |
| 74 | { |
| 75 | return InvalidMagicMethodCall::becauseFieldNotFoundIn($entityName, $fieldName, $method); |
| 76 | } |
| 77 | public static function invalidFindByInverseAssociation($entityName, $associationFieldName) |
| 78 | { |
| 79 | return InvalidFindByCall::fromInverseSideUsage($entityName, $associationFieldName); |
| 80 | } |
| 81 | public static function invalidResultCacheDriver() |
| 82 | { |
| 83 | return InvalidResultCacheDriver::create(); |
| 84 | } |
| 85 | public static function notSupported() |
| 86 | { |
| 87 | return NotSupported::create(); |
| 88 | } |
| 89 | public static function queryCacheNotConfigured() |
| 90 | { |
| 91 | return QueryCacheNotConfigured::create(); |
| 92 | } |
| 93 | public static function metadataCacheNotConfigured() |
| 94 | { |
| 95 | return MetadataCacheNotConfigured::create(); |
| 96 | } |
| 97 | public static function queryCacheUsesNonPersistentCache(CacheDriver $cache) |
| 98 | { |
| 99 | return QueryCacheUsesNonPersistentCache::fromDriver($cache); |
| 100 | } |
| 101 | public static function metadataCacheUsesNonPersistentCache(CacheDriver $cache) |
| 102 | { |
| 103 | return MetadataCacheUsesNonPersistentCache::fromDriver($cache); |
| 104 | } |
| 105 | public static function proxyClassesAlwaysRegenerating() |
| 106 | { |
| 107 | return ProxyClassesAlwaysRegenerating::create(); |
| 108 | } |
| 109 | public static function unknownEntityNamespace($entityNamespaceAlias) |
| 110 | { |
| 111 | return UnknownEntityNamespace::fromNamespaceAlias($entityNamespaceAlias); |
| 112 | } |
| 113 | public static function invalidEntityRepository($className) |
| 114 | { |
| 115 | return InvalidEntityRepository::fromClassName($className); |
| 116 | } |
| 117 | public static function missingIdentifierField($className, $fieldName) |
| 118 | { |
| 119 | return MissingIdentifierField::fromFieldAndClass($fieldName, $className); |
| 120 | } |
| 121 | public static function unrecognizedIdentifierFields($className, $fieldNames) |
| 122 | { |
| 123 | return UnrecognizedIdentifierFields::fromClassAndFieldNames($className, $fieldNames); |
| 124 | } |
| 125 | public static function cantUseInOperatorOnCompositeKeys() |
| 126 | { |
| 127 | return CantUseInOperatorOnCompositeKeys::create(); |
| 128 | } |
| 129 | } |
| 130 |