Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.1.4, 1.1.5
-
Fix Version/s: 1.2.0-BETA3
-
Component/s: Behaviors
-
Labels:None
-
Environment:WindowsXP, WAMP 2.0
Description
Scenario:
class User extends Doctrine_Record
{
public function setTableDefinition()
public function setUp()
{ $this->actAs('SoftDelete'); }}
Test:
//create User
$user = new User();
$user->username = 'Fabian';
$user->email = 'fabian@test.com';
$user->save();
...
...
// delete user
$user = Doctrine_Query::create()
->select('*')
->from('User')
->where("id=1")
->fetchOne();
$user->delete(); //this mark as deleted the user (delete_at field)
....
....
//create User with same data
$user = new User();
$user->username = 'Fabian';
$user->email = 'fabian@test.com';
$user->save();
// This throw error by the "unique"
I think you should add deleted_at to the array of fields to be unique by.