#1683: Table with 1-m and m-1 relationship to the same other table does not load
data from fixture correctly
-----------------------------------+----------------------------------------
 Reporter:  isleshocky77           |       Owner:  jwage
     Type:  defect                 |      Status:  new  
 Priority:  major                  |   Milestone:  1.0.4
Component:  Data Fixtures          |     Version:  1.0.3
 Keywords:                         |    Has_test:  0    
 Mystatus:  Pending Core Response  |   Has_patch:  0    
-----------------------------------+----------------------------------------
 I have Image which has one Image as DefaultImage and has many Image as
 Images.  When I set this up in the fixture file the Image which is being
 used as the DefaultImage ends up losing its item_id.

 {{{
 #!yaml
 # schema.yml
 Item:
   actAs:
     Timestampable:
     Sluggable:
   columns:
     category_id: integer
     name: string(255)
     description: string
     date_start: timestamp
     date_completed: timestamp
     man_hours_to_complete: decimal
     default_image_id: integer
   relations:
     Category:
       foreignAlias: Items
     DefaultImage:
       class: Image
       local: default_image_id

 Image:
   actAs:
     Timestampable:
     Sluggable:
   columns:
     item_id: integer
     name: string(255)
     description: string
     filename: string(255)
   relations:
     Item:
       foreignAlias: Images
 }}}

 {{{
 #!yaml
 # fixtures.yml
 Item:
   Rocking_Chair:
     name: Rocking Chair
     description: This is a rocking chair which was restored
     Category: Category_1_1
     date_start: '2008-01-02'
     date_completed: '2008-02-04'
     DefaultImage: Rocking_Chair_Before

 Image:
   Rocking_Chair_Before:
     Item: Rocking_Chair
     name: Before
     description: This is what it looked like before
     filename: 52edc29bb325004d063a508d73445226af12db3e.jpg
   Rocking_Chair_After:
     Item: Rocking_Chair
     name: After
     description: This is what it looked like after
     filename: 0d135e9f73bb7e68b037b4332b87c5fc2867592b.jpg
 }}}

 After loading this fixture file I would end up with

 '''Item'''
 ||id||name||default_image_id||
 ||1||Rocking Chair||1||

 '''Image'''
 ||id||name||item_id||
 ||1||Before||||
 ||2||After||1||

 The '''Image''' table should be

 '''Image'''
 ||id||name||item_id||
 ||1||Before||1||
 ||2||After||1||

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1683>
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