Ticket #632 (closed enhancement: fixed)

Opened 19 months ago

Last modified 9 months ago

change behavior of "unset" from "delete" to "unlink"

Reported by: chris Owned by: somebody
Priority: critical Milestone: 1.0.3
Component: Other Version: 1.0.2
Severity: Keywords:
Cc: Has Test: no
Status: Pending Core Response Has Patch: no

Description

$book = new Book();
$book->title = "Jungle Expedition Handbook";

$archimedes2 = new Author();
$archimedes2->name = 'Archimedes Q. Porter 2';
$archimedes2->books[] = $book;
$archimedes2->save();

unset($archimedes2->books[0]);
$archimedes2->save();

The unset function deletes the book row and the association table entry. I think it would be much more intuitive if it would ONLY remove the association table row, but not the book row. Object can still be explicitly deleted using the delete method. Until now the unlink method is used to only delete the association, but it can only be used if an object has an id, thus not if an object was not yet saved to the database.

Change History

Changed 19 months ago by romanb

  • milestone set to beta3

Changed 18 months ago by anonymous

  • milestone beta3 deleted

Milestone beta3 deleted

Changed 18 months ago by jwage

  • milestone set to 1.0

Changed 16 months ago by anonymous

  • milestone 1.0 deleted

Milestone 1.0 deleted

Changed 10 months ago by jwage

  • has_patch unset
  • milestone changed from 2.0.0 to 1.0.1
  • mystatus set to Pending Core Response
  • version set to 1.0
  • has_test unset

Changed 10 months ago by jwage

  • milestone changed from 1.0.1 to 1.0.2

Changed 10 months ago by jwage

  • milestone changed from 1.0.3 to 1.1.0

Changed 9 months ago by jwage

  • version changed from 1.0.0 to 1.0.2
  • milestone changed from 1.1.0 to 1.0.3

In r5043 this was fixed for Doctrine 1.0

I am considering whether or not this can be committed to 1.0 also? I think so.

Changed 9 months ago by jwage

Sorry. I meant this was committed for Doctrine 1.1

Changed 9 months ago by jwage

  • status changed from new to closed
  • resolution set to fixed

In r5049 this was committed to 1.0 as well.

Note: See TracTickets for help on using tickets.