mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1194: Problem using Instance of feature #1501
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 (Jun 3, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user hrajchert:
Hi, i get this error message when executing a query with INSTANCE OF.
Notice: Undefined index: \model\PeopleTaskRecommendFriends in /usr/share/php/Doctrine/ORM/Query/SqlWalker.php on line 1626
The query to be executed is this:
The query actually being executed is this:
The first problem is that for some reason its translating the query with a wrong where clause, so of course no data is returned.
Here is the model
@doctrinebot commented on GitHub (Jun 5, 2011):
Comment created by @beberlei:
A fix for this is probably just ommitting the prefix \ infront of the model in the DQL. Class Names in Strings are ALWAYS fully qualified, therefore the leading slash has to be omitted.
@doctrinebot commented on GitHub (Jun 5, 2011):
Comment created by @beberlei:
Improved error handling when in "a INSTANCE OF b" the classes a and b are unrelated.
@doctrinebot commented on GitHub (Jun 5, 2011):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Jun 10, 2011):
Comment created by hrajchert:
Thanks, that did solve my problem.
On a related note, for the original query i had to do this:
$qb->andWhere('pt INSTANCE OF '.$task_type);
instead of this
$qb->andWhere('pt INSTANCE OF :taskType');
$qb->setParameter('taskType', $task_type);
because it complains about the parameter not being a metadata type, and i couldnt find a way to get the metadata type.