1
0
mirror of synced 2024-12-13 14:56:01 +03:00
doctrine2/tests_old/models/SoftDeleteTest.php
2008-02-08 17:41:01 +00:00

21 lines
563 B
PHP

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