Class

SoftDeleteBehavior

class SoftDeleteBehavior extends Behavior

Gives a model class the ability to remain in database even when the user deletes object Uses an additional column storing the deletion date And an additional condition for every read query to only consider rows with no deletion date

Methods

setName(string $name)

Sets the name of the Behavior

from Behavior
string getName()

Returns the name of the Behavior

from Behavior
setTable(Table $table)

Sets the table this behavior is applied to

from Behavior
Table getTable()

Returns the table this behavior is applied to

from Behavior
setDatabase(Database $database)

Sets the database this behavior is applied to

from Behavior
Database getDatabase()

Returns the table this behavior is applied to if behavior is applied to element.

from Behavior
addParameter(array $attribute)

Add a parameter Expects an associative array looking like array('name' => 'foo', 'value' => bar)

from Behavior
setParameters(array $parameters)

Overrides the behavior parameters Expects an associative array looking like array('foo' => 'bar')

from Behavior
array getParameters()

Get the associative array of parameters

from Behavior
getParameter($name)

from Behavior
setTableModificationOrder($tableModificationOrder $tableModificationOrder)

Define when this behavior must execute its modifyTable() relative to other behaviors.

from Behavior
integer getTableModificationOrder()

Get when this behavior must execute its modifyTable() relative to other behaviors.

from Behavior
modifyDatabase()

This method is automatically called on database behaviors when the database model is finished Propagate the behavior to the tables of the database Override this method to have a database behavior do something special

from Behavior
modifyTable()

Add the deleted_column to the current table

setTableModified($bool)

from Behavior
isTableModified()

from Behavior
string renderTemplate(string $filename, array $vars = array(), string $templateDir = '/templates/')

Use Propel's simple templating system to render a PHP file using variables passed as arguments.

from Behavior
ColumnMap getColumnForParameter(string $param)

Retrieve a column object using a name stored in the behavior parameters Useful for table behaviors

from Behavior
appendXml(DOMNode $node)

from Behavior
getTableModifier()

from Behavior
getObjectBuilderModifier()

from Behavior
getQueryBuilderModifier()

from Behavior
getPeerBuilderModifier()

from Behavior
getTableMapBuilderModifier()

from Behavior
hasAdditionalBuilders()

from Behavior
getAdditionalBuilders()

from Behavior
objectMethods($builder)

addObjectForceDelete($script)

addObjectUndelete($script)

preDelete($builder)

queryAttributes()

queryMethods($builder)

addQueryIncludeDeleted($script)

addQuerySoftDelete($script)

addQueryForceDelete($script)

addQueryForceDeleteAll($script)

addQueryUnDelete($script)

addQueryEnableSoftDelete($script)

addQueryDisableSoftDelete($script)

addQueryIsSoftDeleteEnabled($script)

preSelectQuery($builder)

preDeleteQuery($builder)

staticMethods($builder)

addPeerEnableSoftDelete($script)

addPeerDisableSoftDelete($script)

addPeerIsSoftDeleteEnabled($script)

addPeerDoSoftDelete($script)

addPeerDoDelete2($script)

addPeerDoSoftDeleteAll($script)

addPeerDoDeleteAll2($script)

preSelect($builder)

peerFilter($script)

Details

in Behavior at line 38
public setName(string $name)

Sets the name of the Behavior

Parameters

string $name the name of the behavior

in Behavior at line 48
public string getName()

Returns the name of the Behavior

Return Value

string

in Behavior at line 58
public setTable(Table $table)

Sets the table this behavior is applied to

Parameters

Table $table the table this behavior is applied to

in Behavior at line 68
public Table getTable()

Returns the table this behavior is applied to

Return Value

Table

in Behavior at line 78
public setDatabase(Database $database)

Sets the database this behavior is applied to

Parameters

Database $database the database this behavior is applied to

in Behavior at line 88
public Database getDatabase()

Returns the table this behavior is applied to if behavior is applied to element.

Return Value

Database

in Behavior at line 99
public addParameter(array $attribute)

Add a parameter Expects an associative array looking like array('name' => 'foo', 'value' => bar)

Parameters

array $attribute

in Behavior at line 111
public setParameters(array $parameters)

Overrides the behavior parameters Expects an associative array looking like array('foo' => 'bar')

Parameters

array $parameters

in Behavior at line 121
public array getParameters()

Get the associative array of parameters

Return Value

array

in Behavior at line 126
public getParameter($name)

Parameters

$name

in Behavior at line 141
public setTableModificationOrder($tableModificationOrder $tableModificationOrder)

Define when this behavior must execute its modifyTable() relative to other behaviors.

The bigger the value, the later the behavior is executed. Default is 50.

Parameters

$tableModificationOrder $tableModificationOrder integer

in Behavior at line 152
public integer getTableModificationOrder()

Get when this behavior must execute its modifyTable() relative to other behaviors.

The bigger the value, the later the behavior is executed. Default is 50.

Return Value

integer

in Behavior at line 162
public modifyDatabase()

This method is automatically called on database behaviors when the database model is finished Propagate the behavior to the tables of the database Override this method to have a database behavior do something special

at line 30
public modifyTable()

Add the deleted_column to the current table

in Behavior at line 182
public setTableModified($bool)

Parameters

$bool

in Behavior at line 187
public isTableModified()

in Behavior at line 204
public string renderTemplate(string $filename, array $vars = array(), string $templateDir = '/templates/')

Use Propel's simple templating system to render a PHP file using variables passed as arguments.

Parameters

string $filename The template file name, relative to the behavior's dirname
array $vars An associative array of arguments to be rendered
string $templateDir The name of the template subdirectory

Return Value

string The rendered template

Exceptions

InvalidArgumentException

in Behavior at line 247
public ColumnMap getColumnForParameter(string $param)

Retrieve a column object using a name stored in the behavior parameters Useful for table behaviors

Parameters

string $param Name of the parameter storing the column name

Return Value

ColumnMap The column of the table supporting the behavior

in Behavior at line 265
public appendXml(DOMNode $node)

Parameters

DOMNode $node

See also

parent::appendXml(DOMNode)

in Behavior at line 279
public getTableModifier()

in Behavior at line 284
public getObjectBuilderModifier()

in Behavior at line 289
public getQueryBuilderModifier()

in Behavior at line 294
public getPeerBuilderModifier()

in Behavior at line 299
public getTableMapBuilderModifier()

in Behavior at line 304
public hasAdditionalBuilders()

in Behavior at line 309
public getAdditionalBuilders()

at line 45
public objectMethods($builder)

Parameters

$builder

at line 55
public addObjectForceDelete($script)

Parameters

$script

at line 75
public addObjectUndelete($script)

Parameters

$script

at line 92
public preDelete($builder)

Parameters

$builder

at line 122
public queryAttributes()

at line 129
public queryMethods($builder)

Parameters

$builder

at line 145
public addQueryIncludeDeleted($script)

Parameters

$script

at line 165
public addQuerySoftDelete($script)

Parameters

$script

at line 182
public addQueryForceDelete($script)

Parameters

$script

at line 199
public addQueryForceDeleteAll($script)

Parameters

$script

at line 215
public addQueryUnDelete($script)

Parameters

$script

at line 232
public addQueryEnableSoftDelete($script)

Parameters

$script

at line 245
public addQueryDisableSoftDelete($script)

Parameters

$script

at line 258
public addQueryIsSoftDeleteEnabled($script)

Parameters

$script

at line 273
public preSelectQuery($builder)

Parameters

$builder

at line 283
public preDeleteQuery($builder)

Parameters

$builder

at line 294
public staticMethods($builder)

Parameters

$builder

at line 310
public addPeerEnableSoftDelete($script)

Parameters

$script

at line 325
public addPeerDisableSoftDelete($script)

Parameters

$script

at line 338
public addPeerIsSoftDeleteEnabled($script)

Parameters

$script

at line 352
public addPeerDoSoftDelete($script)

Parameters

$script

at line 404
public addPeerDoDelete2($script)

Parameters

$script

at line 427
public addPeerDoSoftDeleteAll($script)

Parameters

$script

at line 454
public addPeerDoDeleteAll2($script)

Parameters

$script

at line 476
public preSelect($builder)

Parameters

$builder

at line 486
public peerFilter($script)

Parameters

$script