mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-249: QueryBuilder documentation states that select() takes an array, but expects strings #307
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Jan 12, 2010).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user shurakai:
If you try to execute something like
$qb->select(array('u', 'a'))
->from('Entities\User', 'u')
->leftJoin('Entities\Address', 'a')
->where('u.age = 23');
which should be correct if one takes a look at the third example here: http://www.doctrine-project.org/documentation/manual/2_0/en/query-builder#the-querybuilder:working-with-querybuilder:helper-methods
then one will recieve an exception to be thrown, because the ORM\QueryBuilder::select() method makes an internal call for get_func_args() and therefore will pass an array within an array to the ORM\Query\Base class.
In fact, I propose to change the internal of the select() method and check whether an array has been passed and if yes, do not call get_func_args().
By the way, I think that arrays should be supported because it's much easier to dynamically pass an array as an argument than several strings.
Regards
Christian