diff options
Diffstat (limited to 'vendor/doctrine/orm/src/Repository/Exception')
-rw-r--r-- | vendor/doctrine/orm/src/Repository/Exception/InvalidFindByCall.php | 21 | ||||
-rw-r--r-- | vendor/doctrine/orm/src/Repository/Exception/InvalidMagicMethodCall.php | 27 |
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 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Doctrine\ORM\Repository\Exception; | ||
6 | |||
7 | use Doctrine\ORM\Exception\RepositoryException; | ||
8 | use LogicException; | ||
9 | |||
10 | final 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 | |||
3 | declare(strict_types=1); | ||
4 | |||
5 | namespace Doctrine\ORM\Repository\Exception; | ||
6 | |||
7 | use Doctrine\ORM\Exception\RepositoryException; | ||
8 | use LogicException; | ||
9 | |||
10 | final 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 | } | ||