summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Exception
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/orm/src/Exception')
-rw-r--r--vendor/doctrine/orm/src/Exception/ConfigurationException.php9
-rw-r--r--vendor/doctrine/orm/src/Exception/EntityIdentityCollisionException.php39
-rw-r--r--vendor/doctrine/orm/src/Exception/EntityManagerClosed.php15
-rw-r--r--vendor/doctrine/orm/src/Exception/EntityMissingAssignedId.php20
-rw-r--r--vendor/doctrine/orm/src/Exception/InvalidEntityRepository.php18
-rw-r--r--vendor/doctrine/orm/src/Exception/InvalidHydrationMode.php17
-rw-r--r--vendor/doctrine/orm/src/Exception/ManagerException.php11
-rw-r--r--vendor/doctrine/orm/src/Exception/MissingIdentifierField.php21
-rw-r--r--vendor/doctrine/orm/src/Exception/MissingMappingDriverImplementation.php18
-rw-r--r--vendor/doctrine/orm/src/Exception/MultipleSelectorsFoundException.php26
-rw-r--r--vendor/doctrine/orm/src/Exception/NotSupported.php44
-rw-r--r--vendor/doctrine/orm/src/Exception/ORMException.php11
-rw-r--r--vendor/doctrine/orm/src/Exception/PersisterException.php11
-rw-r--r--vendor/doctrine/orm/src/Exception/RepositoryException.php13
-rw-r--r--vendor/doctrine/orm/src/Exception/SchemaToolException.php11
-rw-r--r--vendor/doctrine/orm/src/Exception/UnexpectedAssociationValue.php27
-rw-r--r--vendor/doctrine/orm/src/Exception/UnrecognizedIdentifierFields.php23
17 files changed, 334 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Exception/ConfigurationException.php b/vendor/doctrine/orm/src/Exception/ConfigurationException.php
new file mode 100644
index 0000000..45cf83f
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/ConfigurationException.php
@@ -0,0 +1,9 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7interface ConfigurationException extends ORMException
8{
9}
diff --git a/vendor/doctrine/orm/src/Exception/EntityIdentityCollisionException.php b/vendor/doctrine/orm/src/Exception/EntityIdentityCollisionException.php
new file mode 100644
index 0000000..0af3162
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/EntityIdentityCollisionException.php
@@ -0,0 +1,39 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use Exception;
8
9use function sprintf;
10
11final class EntityIdentityCollisionException extends Exception implements ORMException
12{
13 public static function create(object $existingEntity, object $newEntity, string $idHash): self
14 {
15 return new self(
16 sprintf(
17 <<<'EXCEPTION'
18While adding an entity of class %s with an ID hash of "%s" to the identity map,
19another object of class %s was already present for the same ID. This exception
20is a safeguard against an internal inconsistency - IDs should uniquely map to
21entity object instances. This problem may occur if:
22
23- you use application-provided IDs and reuse ID values;
24- database-provided IDs are reassigned after truncating the database without
25clearing the EntityManager;
26- you might have been using EntityManager#getReference() to create a reference
27for a nonexistent ID that was subsequently (by the RDBMS) assigned to another
28entity.
29
30Otherwise, it might be an ORM-internal inconsistency, please report it.
31EXCEPTION
32 ,
33 $newEntity::class,
34 $idHash,
35 $existingEntity::class,
36 ),
37 );
38 }
39}
diff --git a/vendor/doctrine/orm/src/Exception/EntityManagerClosed.php b/vendor/doctrine/orm/src/Exception/EntityManagerClosed.php
new file mode 100644
index 0000000..a769202
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/EntityManagerClosed.php
@@ -0,0 +1,15 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use RuntimeException;
8
9final class EntityManagerClosed extends RuntimeException implements ManagerException
10{
11 public static function create(): self
12 {
13 return new self('The EntityManager is closed.');
14 }
15}
diff --git a/vendor/doctrine/orm/src/Exception/EntityMissingAssignedId.php b/vendor/doctrine/orm/src/Exception/EntityMissingAssignedId.php
new file mode 100644
index 0000000..d566436
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/EntityMissingAssignedId.php
@@ -0,0 +1,20 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use LogicException;
8
9use function get_debug_type;
10
11final class EntityMissingAssignedId extends LogicException implements ORMException
12{
13 public static function forField(object $entity, string $field): self
14 {
15 return new self('Entity of type ' . get_debug_type($entity) . " is missing an assigned ID for field '" . $field . "'. " .
16 'The identifier generation strategy for this entity requires the ID field to be populated before ' .
17 'EntityManager#persist() is called. If you want automatically generated identifiers instead ' .
18 'you need to adjust the metadata mapping accordingly.');
19 }
20}
diff --git a/vendor/doctrine/orm/src/Exception/InvalidEntityRepository.php b/vendor/doctrine/orm/src/Exception/InvalidEntityRepository.php
new file mode 100644
index 0000000..c28143d
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/InvalidEntityRepository.php
@@ -0,0 +1,18 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use Doctrine\ORM\EntityRepository;
8use LogicException;
9
10final class InvalidEntityRepository extends LogicException implements ConfigurationException
11{
12 public static function fromClassName(string $className): self
13 {
14 return new self(
15 "Invalid repository class '" . $className . "'. It must be a " . EntityRepository::class . '.',
16 );
17 }
18}
diff --git a/vendor/doctrine/orm/src/Exception/InvalidHydrationMode.php b/vendor/doctrine/orm/src/Exception/InvalidHydrationMode.php
new file mode 100644
index 0000000..d07d84c
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/InvalidHydrationMode.php
@@ -0,0 +1,17 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use LogicException;
8
9use function sprintf;
10
11final class InvalidHydrationMode extends LogicException implements ManagerException
12{
13 public static function fromMode(string $mode): self
14 {
15 return new self(sprintf('"%s" is an invalid hydration mode.', $mode));
16 }
17}
diff --git a/vendor/doctrine/orm/src/Exception/ManagerException.php b/vendor/doctrine/orm/src/Exception/ManagerException.php
new file mode 100644
index 0000000..f9bc7ff
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/ManagerException.php
@@ -0,0 +1,11 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use Throwable;
8
9interface ManagerException extends Throwable
10{
11}
diff --git a/vendor/doctrine/orm/src/Exception/MissingIdentifierField.php b/vendor/doctrine/orm/src/Exception/MissingIdentifierField.php
new file mode 100644
index 0000000..2c02db4
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/MissingIdentifierField.php
@@ -0,0 +1,21 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use LogicException;
8
9use function sprintf;
10
11final class MissingIdentifierField extends LogicException implements ManagerException
12{
13 public static function fromFieldAndClass(string $fieldName, string $className): self
14 {
15 return new self(sprintf(
16 'The identifier %s is missing for a query of %s',
17 $fieldName,
18 $className,
19 ));
20 }
21}
diff --git a/vendor/doctrine/orm/src/Exception/MissingMappingDriverImplementation.php b/vendor/doctrine/orm/src/Exception/MissingMappingDriverImplementation.php
new file mode 100644
index 0000000..ce5104b
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/MissingMappingDriverImplementation.php
@@ -0,0 +1,18 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use LogicException;
8
9final class MissingMappingDriverImplementation extends LogicException implements ManagerException
10{
11 public static function create(): self
12 {
13 return new self(
14 "It's a requirement to specify a Metadata Driver and pass it " .
15 'to Doctrine\\ORM\\Configuration::setMetadataDriverImpl().',
16 );
17 }
18}
diff --git a/vendor/doctrine/orm/src/Exception/MultipleSelectorsFoundException.php b/vendor/doctrine/orm/src/Exception/MultipleSelectorsFoundException.php
new file mode 100644
index 0000000..8084d66
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/MultipleSelectorsFoundException.php
@@ -0,0 +1,26 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use LogicException;
8
9use function implode;
10use function sprintf;
11
12final class MultipleSelectorsFoundException extends LogicException implements ORMException
13{
14 public const MULTIPLE_SELECTORS_FOUND_EXCEPTION = 'Multiple selectors found: %s. Please select only one.';
15
16 /** @param string[] $selectors */
17 public static function create(array $selectors): self
18 {
19 return new self(
20 sprintf(
21 self::MULTIPLE_SELECTORS_FOUND_EXCEPTION,
22 implode(', ', $selectors),
23 ),
24 );
25 }
26}
diff --git a/vendor/doctrine/orm/src/Exception/NotSupported.php b/vendor/doctrine/orm/src/Exception/NotSupported.php
new file mode 100644
index 0000000..9192f87
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/NotSupported.php
@@ -0,0 +1,44 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use LogicException;
8
9use function sprintf;
10
11/** @deprecated */
12final class NotSupported extends LogicException implements ORMException
13{
14 public static function create(): self
15 {
16 return new self('This behaviour is (currently) not supported by Doctrine 2');
17 }
18
19 public static function createForDbal3(string $context): self
20 {
21 return new self(sprintf(
22 <<<'EXCEPTION'
23Context: %s
24Problem: Feature was deprecated in doctrine/dbal 2.x and is not supported by installed doctrine/dbal:3.x
25Solution: See the doctrine/deprecations logs for new alternative approaches.
26EXCEPTION
27 ,
28 $context,
29 ));
30 }
31
32 public static function createForPersistence3(string $context): self
33 {
34 return new self(sprintf(
35 <<<'EXCEPTION'
36Context: %s
37Problem: Feature was deprecated in doctrine/persistence 2.x and is not supported by installed doctrine/persistence:3.x
38Solution: See the doctrine/deprecations logs for new alternative approaches.
39EXCEPTION
40 ,
41 $context,
42 ));
43 }
44}
diff --git a/vendor/doctrine/orm/src/Exception/ORMException.php b/vendor/doctrine/orm/src/Exception/ORMException.php
new file mode 100644
index 0000000..a59b483
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/ORMException.php
@@ -0,0 +1,11 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use Throwable;
8
9interface ORMException extends Throwable
10{
11}
diff --git a/vendor/doctrine/orm/src/Exception/PersisterException.php b/vendor/doctrine/orm/src/Exception/PersisterException.php
new file mode 100644
index 0000000..2563a46
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/PersisterException.php
@@ -0,0 +1,11 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use Doctrine\ORM\Persisters\PersisterException as BasePersisterException;
8
9class PersisterException extends BasePersisterException
10{
11}
diff --git a/vendor/doctrine/orm/src/Exception/RepositoryException.php b/vendor/doctrine/orm/src/Exception/RepositoryException.php
new file mode 100644
index 0000000..3b2d51b
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/RepositoryException.php
@@ -0,0 +1,13 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7/**
8 * This interface should be implemented by all exceptions in the Repository
9 * namespace.
10 */
11interface RepositoryException extends ORMException
12{
13}
diff --git a/vendor/doctrine/orm/src/Exception/SchemaToolException.php b/vendor/doctrine/orm/src/Exception/SchemaToolException.php
new file mode 100644
index 0000000..e4477d0
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/SchemaToolException.php
@@ -0,0 +1,11 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use Throwable;
8
9interface SchemaToolException extends Throwable
10{
11}
diff --git a/vendor/doctrine/orm/src/Exception/UnexpectedAssociationValue.php b/vendor/doctrine/orm/src/Exception/UnexpectedAssociationValue.php
new file mode 100644
index 0000000..cf3ca18
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/UnexpectedAssociationValue.php
@@ -0,0 +1,27 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use Doctrine\ORM\Cache\Exception\CacheException;
8
9use function sprintf;
10
11final class UnexpectedAssociationValue extends CacheException
12{
13 public static function create(
14 string $class,
15 string $association,
16 string $given,
17 string $expected,
18 ): self {
19 return new self(sprintf(
20 'Found entity of type %s on association %s#%s, but expecting %s',
21 $given,
22 $class,
23 $association,
24 $expected,
25 ));
26 }
27}
diff --git a/vendor/doctrine/orm/src/Exception/UnrecognizedIdentifierFields.php b/vendor/doctrine/orm/src/Exception/UnrecognizedIdentifierFields.php
new file mode 100644
index 0000000..645bdae
--- /dev/null
+++ b/vendor/doctrine/orm/src/Exception/UnrecognizedIdentifierFields.php
@@ -0,0 +1,23 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Exception;
6
7use LogicException;
8
9use function implode;
10use function sprintf;
11
12final class UnrecognizedIdentifierFields extends LogicException implements ManagerException
13{
14 /** @param string[] $fieldNames */
15 public static function fromClassAndFieldNames(string $className, array $fieldNames): self
16 {
17 return new self(sprintf(
18 'Unrecognized identifier fields: "%s" are not present on class "%s".',
19 implode("', '", $fieldNames),
20 $className,
21 ));
22 }
23}