From bf6655a534a6775d30cafa67bd801276bda1d98d Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 13 Aug 2024 23:45:21 +0200 Subject: =?UTF-8?q?VERSION=200.2=20doctrine=20ORM=20et=20entit=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/doctrine/orm/src/Query/QueryException.php | 155 +++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 vendor/doctrine/orm/src/Query/QueryException.php (limited to 'vendor/doctrine/orm/src/Query/QueryException.php') diff --git a/vendor/doctrine/orm/src/Query/QueryException.php b/vendor/doctrine/orm/src/Query/QueryException.php new file mode 100644 index 0000000..ae945b1 --- /dev/null +++ b/vendor/doctrine/orm/src/Query/QueryException.php @@ -0,0 +1,155 @@ + or ? expected.'); + } + + public static function unknownParameter(string $key): self + { + return new self('Invalid parameter: token ' . $key . ' is not defined in the query.'); + } + + public static function parameterTypeMismatch(): self + { + return new self('DQL Query parameter and type numbers mismatch, but have to be exactly equal.'); + } + + public static function invalidPathExpression(PathExpression $pathExpr): self + { + return new self( + "Invalid PathExpression '" . $pathExpr->identificationVariable . '.' . $pathExpr->field . "'.", + ); + } + + public static function invalidLiteral(string|Stringable $literal): self + { + return new self("Invalid literal '" . $literal . "'"); + } + + public static function iterateWithFetchJoinCollectionNotAllowed(AssociationMapping $assoc): self + { + return new self( + 'Invalid query operation: Not allowed to iterate over fetch join collections ' . + 'in class ' . $assoc->sourceEntity . ' association ' . $assoc->fieldName, + ); + } + + /** + * @param string[] $assoc + * @psalm-param array $assoc + */ + public static function overwritingJoinConditionsNotYetSupported(array $assoc): self + { + return new self( + 'Unsupported query operation: It is not yet possible to overwrite the join ' . + 'conditions in class ' . $assoc['sourceEntityName'] . ' association ' . $assoc['fieldName'] . '. ' . + 'Use WITH to append additional join conditions to the association.', + ); + } + + public static function associationPathInverseSideNotSupported(PathExpression $pathExpr): self + { + return new self( + 'A single-valued association path expression to an inverse side is not supported in DQL queries. ' . + 'Instead of "' . $pathExpr->identificationVariable . '.' . $pathExpr->field . '" use an explicit join.', + ); + } + + public static function iterateWithFetchJoinNotAllowed(AssociationMapping $assoc): self + { + return new self( + 'Iterate with fetch join in class ' . $assoc->sourceEntity . + ' using association ' . $assoc->fieldName . ' not allowed.', + ); + } + + public static function eagerFetchJoinWithNotAllowed(string $sourceEntity, string $fieldName): self + { + return new self( + 'Associations with fetch-mode=EAGER may not be using WITH conditions in + "' . $sourceEntity . '#' . $fieldName . '".', + ); + } + + public static function iterateWithMixedResultNotAllowed(): self + { + return new self('Iterating a query with mixed results (using scalars) is not supported.'); + } + + public static function associationPathCompositeKeyNotSupported(): self + { + return new self( + 'A single-valued association path expression to an entity with a composite primary ' . + 'key is not supported. Explicitly name the components of the composite primary key ' . + 'in the query.', + ); + } + + public static function instanceOfUnrelatedClass(string $className, string $rootClass): self + { + return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " . + 'inheritance hierarchy does not exists between these two classes.'); + } + + public static function invalidQueryComponent(string $dqlAlias): self + { + return new self( + "Invalid query component given for DQL alias '" . $dqlAlias . "', " . + "requires 'metadata', 'parent', 'relation', 'map', 'nestingLevel' and 'token' keys.", + ); + } +} -- cgit v1.2.3