. */ /** * Doctrine_Template_SoftDelete * * @package Doctrine * @subpackage Template * @license http://www.opensource.org/licenses/lgpl-license.php LGPL * @link www.phpdoctrine.org * @since 1.0 * @version $Revision$ * @author Konsta Vesterinen * @author Jonathan H. Wage */ class Doctrine_Template_SoftDelete extends Doctrine_Template { /** * Array of SoftDelete options * * @var string */ protected $_options = array('name' => 'deleted_at', 'type' => 'timestamp', 'length' => null, 'options' => array('default' => null, 'notnull' => false)); /** * Set table definition for SoftDelete behavior * * @return void */ public function setTableDefinition() { // BC to 1.0.X of SoftDelete behavior if ($this->_options['type'] == 'boolean') { $this->_options['length'] = 1; $this->_options['options'] = array('default' => false, 'notnull' => true); } $this->hasColumn($this->_options['name'], $this->_options['type'], $this->_options['length'], $this->_options['options']); $this->addListener(new Doctrine_Template_Listener_SoftDelete($this->_options)); } }