class Doctrine_Template_Listener_SoftDelete extends Doctrine_Record_Listener (View source)

Listener for SoftDelete behavior which will allow you to turn on the behavior which sets a delete flag instead of actually deleting the record and all queries automatically include a check for the deleted flag to exclude deleted records.

Properties

protected string $_options Array of SoftDelete options

Methods

setOption($name, $value = null)

setOption sets an option in order to allow flexible listener

getOptions()

getOptions returns all options of this template and the associated values

getOption($name)

getOption returns the value of given option

preDqlSelect(Doctrine_Event $event)

Implement preDqlSelect() hook and add the deleted flag to all queries for which this model is being used in.

preSave(Doctrine_Event $event)

No description

postSave(Doctrine_Event $event)

No description

preDqlDelete(Doctrine_Event $event)

Implement preDqlDelete() hook and modify a dql delete query so it updates the deleted flag instead of deleting the record

preDelete(Doctrine_Event $event)

Skip the normal delete options so we can override it with our own

postDelete(Doctrine_Event $event)

Implement postDelete() hook and set the deleted flag to true

preUpdate(Doctrine_Event $event)

No description

postUpdate(Doctrine_Event $event)

No description

preInsert(Doctrine_Event $event)

No description

postInsert(Doctrine_Event $event)

No description

preHydrate(Doctrine_Event $event)

No description

postHydrate(Doctrine_Event $event)

No description

preValidate(Doctrine_Event $event)

No description

void
__construct(array $options)

__construct

void
hardDelete(boolean $bool)

Set the hard delete flag so that it is really deleted

Details

setOption($name, $value = null)

setOption sets an option in order to allow flexible listener

Parameters

$name
$value

getOptions()

getOptions returns all options of this template and the associated values

getOption($name)

getOption returns the value of given option

Parameters

$name

preSerialize(Doctrine_Event $event)

Parameters

Doctrine_Event $event

postSerialize(Doctrine_Event $event)

Parameters

Doctrine_Event $event

preUnserialize(Doctrine_Event $event)

Parameters

Doctrine_Event $event

postUnserialize(Doctrine_Event $event)

Parameters

Doctrine_Event $event

preDqlSelect(Doctrine_Event $event)

Implement preDqlSelect() hook and add the deleted flag to all queries for which this model is being used in.

Parameters

Doctrine_Event $event

preSave(Doctrine_Event $event)

Parameters

Doctrine_Event $event

postSave(Doctrine_Event $event)

Parameters

Doctrine_Event $event

preDqlDelete(Doctrine_Event $event)

Implement preDqlDelete() hook and modify a dql delete query so it updates the deleted flag instead of deleting the record

Parameters

Doctrine_Event $event

preDelete(Doctrine_Event $event)

Skip the normal delete options so we can override it with our own

Parameters

Doctrine_Event $event

postDelete(Doctrine_Event $event)

Implement postDelete() hook and set the deleted flag to true

Parameters

Doctrine_Event $event

preDqlUpdate(Doctrine_Event $event)

Parameters

Doctrine_Event $event

preUpdate(Doctrine_Event $event)

Parameters

Doctrine_Event $event

postUpdate(Doctrine_Event $event)

Parameters

Doctrine_Event $event

preInsert(Doctrine_Event $event)

Parameters

Doctrine_Event $event

postInsert(Doctrine_Event $event)

Parameters

Doctrine_Event $event

preHydrate(Doctrine_Event $event)

Parameters

Doctrine_Event $event

postHydrate(Doctrine_Event $event)

Parameters

Doctrine_Event $event

preValidate(Doctrine_Event $event)

Parameters

Doctrine_Event $event

postValidate(Doctrine_Event $event)

Parameters

Doctrine_Event $event

void __construct(array $options)

__construct

Parameters

array $options

Return Value

void

void hardDelete(boolean $bool)

Set the hard delete flag so that it is really deleted

Parameters

boolean $bool

Return Value

void