DDC-1832: register<DATATYPE>Function methods missing from \Doctrine\ORM\Query\Parser #2311

Closed
opened 2026-01-22 13:47:59 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (May 22, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user awesome:

The example in the documentation at http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/dql-doctrine-query-language.html#adding-your-own-functions-to-the-dql-language specifies that custom functions should be registered using \Doctrine\ORM\Query\Parser::registerNumericFunction() this method (or methods for other datatypes) does not seem to exist anywhere. I would fork and add these methods but I am not sure if they were there and were removed or whether they just got lost.

ta.

To reproduce simply call:

\Doctrine\ORM\Query\Parser::registerNumericFunction('name', 'class');

Boom!

Chris

Originally created by @doctrinebot on GitHub (May 22, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user awesome: The example in the documentation at http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/dql-doctrine-query-language.html#adding-your-own-functions-to-the-dql-language specifies that custom functions should be registered using \Doctrine\ORM\Query\Parser::registerNumericFunction() this method (or methods for other datatypes) does not seem to exist anywhere. I would fork and add these methods but I am not sure if they were there and were removed or whether they just got lost. ta. To reproduce simply call: \Doctrine\ORM\Query\Parser::registerNumericFunction('name', 'class'); Boom! Chris
admin added the Bug label 2026-01-22 13:47:59 +01:00
admin closed this issue 2026-01-22 13:47:59 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 27, 2012):

Comment created by @beberlei:

Please check the 2.2 documentation, this was changed from 2.0 to 2.2

http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#adding-your-own-functions-to-the-dql-language

@doctrinebot commented on GitHub (May 27, 2012): Comment created by @beberlei: Please check the 2.2 documentation, this was changed from 2.0 to 2.2 http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#adding-your-own-functions-to-the-dql-language
Author
Owner

@doctrinebot commented on GitHub (May 28, 2012):

Comment created by awesome:

The 2.2 documentation seems to be identical and still references \Doctrine\ORM\Query\Parser::registerNumericFunction (which does not exist). Should this bug be in documentation?

@doctrinebot commented on GitHub (May 28, 2012): Comment created by awesome: The 2.2 documentation seems to be identical and still references \Doctrine\ORM\Query\Parser::registerNumericFunction (which does not exist). Should this bug be in documentation?
Author
Owner

@doctrinebot commented on GitHub (May 28, 2012):

Comment created by @beberlei:

Oh yes below there, but see above:

<?php
$config = new \Doctrine\ORM\Configuration();
$config->addCustomStringFunction($name, $class);
$config->addCustomNumericFunction($name, $class);
$config->addCustomDatetimeFunction($name, $class);
@doctrinebot commented on GitHub (May 28, 2012): Comment created by @beberlei: Oh yes below there, but see above: ``` <?php $config = new \Doctrine\ORM\Configuration(); $config->addCustomStringFunction($name, $class); $config->addCustomNumericFunction($name, $class); $config->addCustomDatetimeFunction($name, $class); ```
Author
Owner

@doctrinebot commented on GitHub (May 28, 2012):

Comment created by awesome:

Yes, I see that. It's just ambiguous, I will use the method described but the documentation should be corrected to stop somebody like myself tearing their hair out :P.

@doctrinebot commented on GitHub (May 28, 2012): Comment created by awesome: Yes, I see that. It's just ambiguous, I will use the method described but the documentation should be corrected to stop somebody like myself tearing their hair out :P.
Author
Owner

@doctrinebot commented on GitHub (Jul 4, 2012):

Comment created by @beberlei:

Fixed

@doctrinebot commented on GitHub (Jul 4, 2012): Comment created by @beberlei: Fixed
Author
Owner

@doctrinebot commented on GitHub (Jul 4, 2012):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Jul 4, 2012): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2311