#1529: SoftDeletable Template problem with left join relations
-----------------------------------+----------------------------------------
 Reporter:  MrOxiMoron             |       Owner:  jwage
     Type:  defect                 |      Status:  new  
 Priority:  minor                  |   Milestone:       
Component:  Behaviors              |     Version:  1.0.2
 Keywords:  SoftDeletable          |    Has_test:  0    
 Mystatus:  Pending Core Response  |   Has_patch:  0    
-----------------------------------+----------------------------------------
 I have a Todo and Comments table. a Todo item has many comments.
 They are both softdeletable. (and use_dql_callbacks set to true)

 $todos = Doctrine_Query::create()->from('Todo t')->leftJoin('t.Comments
 c')->execute();

 returns no todo items that have 0 comments.

 The query:
 SELECT t.id AS t__id, t.component AS t__component, t.user AS t__user,
 t.title AS t__title, t.description AS t__description, t.created_at AS
 t__created_at, t.updated_at AS t__updated_at, t.deleted AS t__deleted,
 c.id AS c__id, c.message AS c__message, c.todo_id AS c__todo_id,
 c.created_at AS c__created_at, c.updated_at AS c__updated_at, c.deleted AS
 c__deleted FROM todo t LEFT JOIN comment c ON t.id = c.todo_id WHERE
 t.deleted = 0 AND c.deleted = 0

 The problem is that for the leftJoin the c.deleted is NULL so it isn't 0
 or 1, it simply isn't set.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1529>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to