1
0
mirror of synced 2024-12-13 22:56:04 +03:00
doctrine2/models/SoftDeleteTest.php

21 lines
523 B
PHP

<?php
class SoftDeleteTest extends Doctrine_Record
{
public function setTableDefinition()
{
$this->hasColumn('name', 'string', null, array('primary' => true));
$this->hasColumn('something', 'string', '25', array('notnull' => true, 'unique' => true));
$this->hasColumn('deleted', 'boolean', 1);
}
public function preDelete($event)
{
$event->skipOperation();
}
public function postDelete($event)
{
$this->deleted = true;
$this->save();
}
}