You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44Lines changed: 44 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -242,3 +242,47 @@ abstract class Uuid7Entity
242
242
private Uuid7 $hsCode;
243
243
244
244
```
245
+
246
+
## Custom DQL functions
247
+
248
+
Any custom DQL function that implements Doctrine's `TypedExpression` is understood by this extension and is inferred with the type used in its `getReturnType()` method.
249
+
All other custom DQL functions are inferred as `mixed`.
250
+
Please note that you cannot use native `StringType` to cast (and infer) string results (see [ORM issue](https://github.com/doctrine/orm/issues/11537)).
251
+
252
+
```php
253
+
254
+
use Doctrine\DBAL\Types\Type;
255
+
use Doctrine\DBAL\Types\Types;
256
+
use Doctrine\ORM\Query\AST\TypedExpression;
257
+
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
258
+
use Doctrine\ORM\Query\Parser;
259
+
use Doctrine\ORM\Query\SqlWalker;
260
+
use Doctrine\ORM\Query\TokenType;
261
+
262
+
class Floor extends FunctionNode implements TypedExpression
263
+
{
264
+
private AST\Node|string $arithmeticExpression;
265
+
266
+
public function getSql(SqlWalker $sqlWalker): string
0 commit comments