Created
January 31, 2011 16:04
-
-
Save michaelesmith/804245 to your computer and use it in GitHub Desktop.
Problem fetching the same Doctrine object with two different queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$lead_all = LeadTable::getInstance()->createQuery('l')->leftJoin('l.ToDoItems tdi')->where('l.id = ?', 7)->fetchOne(); | |
echo count($lead_all->getToDoItems()); //prints 4 | |
$NOT_LEAD_ALL = LeadTable::getInstance()->createQuery('l')->leftJoin('l.ToDoItems tdi')->where('l.id = ?', 7)->addWhere('tdi.close_date IS NOT NULL')->fetchOne(); | |
echo count($lead_all->getToDoItems()); //prints 1 instead of 4 like above |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment