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

21 lines
523 B
PHP
Raw Normal View History

<?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();
}
}