summaryrefslogtreecommitdiff
path: root/vendor/doctrine/orm/src/Repository/Exception
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/doctrine/orm/src/Repository/Exception')
-rw-r--r--vendor/doctrine/orm/src/Repository/Exception/InvalidFindByCall.php21
-rw-r--r--vendor/doctrine/orm/src/Repository/Exception/InvalidMagicMethodCall.php27
2 files changed, 48 insertions, 0 deletions
diff --git a/vendor/doctrine/orm/src/Repository/Exception/InvalidFindByCall.php b/vendor/doctrine/orm/src/Repository/Exception/InvalidFindByCall.php
new file mode 100644
index 0000000..c5dd015
--- /dev/null
+++ b/vendor/doctrine/orm/src/Repository/Exception/InvalidFindByCall.php
@@ -0,0 +1,21 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Repository\Exception;
6
7use Doctrine\ORM\Exception\RepositoryException;
8use LogicException;
9
10final class InvalidFindByCall extends LogicException implements RepositoryException
11{
12 public static function fromInverseSideUsage(
13 string $entityName,
14 string $associationFieldName,
15 ): self {
16 return new self(
17 "You cannot search for the association field '" . $entityName . '#' . $associationFieldName . "', " .
18 'because it is the inverse side of an association. Find methods only work on owning side associations.',
19 );
20 }
21}
diff --git a/vendor/doctrine/orm/src/Repository/Exception/InvalidMagicMethodCall.php b/vendor/doctrine/orm/src/Repository/Exception/InvalidMagicMethodCall.php
new file mode 100644
index 0000000..1da49cb
--- /dev/null
+++ b/vendor/doctrine/orm/src/Repository/Exception/InvalidMagicMethodCall.php
@@ -0,0 +1,27 @@
1<?php
2
3declare(strict_types=1);
4
5namespace Doctrine\ORM\Repository\Exception;
6
7use Doctrine\ORM\Exception\RepositoryException;
8use LogicException;
9
10final class InvalidMagicMethodCall extends LogicException implements RepositoryException
11{
12 public static function becauseFieldNotFoundIn(
13 string $entityName,
14 string $fieldName,
15 string $method,
16 ): self {
17 return new self(
18 "Entity '" . $entityName . "' has no field '" . $fieldName . "'. " .
19 "You can therefore not call '" . $method . "' on the entities' repository.",
20 );
21 }
22
23 public static function onMissingParameter(string $methodName): self
24 {
25 return new self("You need to pass a parameter to '" . $methodName . "'");
26 }
27}