[DDC-2112] cascade remove revert order Created: 01/Nov/12 Updated: 08/Nov/12 Resolved: 08/Nov/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Ivan Borzenkov | Assignee: | Benjamin Eberlei |
| Resolution: | Invalid | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
| Description |
|
cascadeRemove incorrect work UnitOfWork in commit() (336) // Entity deletions come last and need to be in reverse commit order } ---------------------------------------------------------------- // Cascade first, because scheduleForDelete() removes the entity from the identity map, which ...... $this->scheduleForDelete($entity); in array we get child revert in commit - first remove parent and get foregein key error if move cascadeRemove after switch all woork correct |
| Comments |
| Comment by Ivan Borzenkov [ 01/Nov/12 ] |
|
patch |
| Comment by Ivan Borzenkov [ 01/Nov/12 ] |
class Domain
{
...
/**
* @ORM\OneToMany(targetEntity="Query", mappedBy="domain", cascade={"all"})
*/
protected $q;
...
}
class Query
{
...
/**
* @ORM\ManyToOne(targetEntity="Domain", inversedBy="q")
*/
protected $domain;
...
}
if remove Domain - get mysql error foreign key |