DDC-792: CLI run-dql --max-result switch calls undefined method #974

Closed
opened 2026-01-22 12:57:47 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 7, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user mjh_ca:

doctrine orm:run-dql "SELECT a FROM Entity\Foo a" --max-result=1

Result:

PHP Fatal error:  Call to undefined method Doctrine\ORM\Query::setMaxResult() in /var/www/mysite.com/library/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php on line 117

Fatal error: Call to undefined method Doctrine\ORM\Query::setMaxResult() in /var/www/mysite.com/library/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php on line 117

Solution:

Update line 117 of Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php to call *setMaxResults* rather than setMaxResult

Originally created by @doctrinebot on GitHub (Sep 7, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user mjh_ca: ``` doctrine orm:run-dql "SELECT a FROM Entity\Foo a" --max-result=1 ``` Result: ``` PHP Fatal error: Call to undefined method Doctrine\ORM\Query::setMaxResult() in /var/www/mysite.com/library/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php on line 117 Fatal error: Call to undefined method Doctrine\ORM\Query::setMaxResult() in /var/www/mysite.com/library/Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php on line 117 ``` Solution: Update line 117 of Doctrine/ORM/Tools/Console/Command/RunDqlCommand.php to call **setMaxResults\* rather than *setMaxResult**
admin added the Bug label 2026-01-22 12:57:47 +01:00
admin closed this issue 2026-01-22 12:57:48 +01:00
Author
Owner

@doctrinebot commented on GitHub (Sep 15, 2010):

Comment created by @guilhermeblanco:

On http://github.com/doctrine/doctrine2/commit/2e3c1506fbeec0f3598a71c8a9624b72c59e3674 this issue was fixed.

Thanks for the report! =)

@doctrinebot commented on GitHub (Sep 15, 2010): Comment created by @guilhermeblanco: On http://github.com/doctrine/doctrine2/commit/2e3c1506fbeec0f3598a71c8a9624b72c59e3674 this issue was fixed. Thanks for the report! =)
Author
Owner

@doctrinebot commented on GitHub (Sep 15, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Sep 15, 2010): 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#974