Propel API
Class

ArchivableBehaviorObjectBuilderModifier

class ArchivableBehaviorObjectBuilderModifier

Keeps tracks of an ActiveRecord object, even after deletion

Methods

__construct($behavior)

string objectAttributes($builder)

string postInsert($builder)

string postUpdate($builder)

string preDelete($builder)

Using preDelete rather than postDelete to allow user to retrieve related records and archive them before cascade deletion.

string objectMethods($builder)

string addGetArchive($builder)

string addArchive($builder)

string addRestoreFromArchive($builder)

string addPopulateFromArchive($builder)

Generates a method to populate the current AR object based on an archive object.

string addSaveWithoutArchive($builder)

string addDeleteWithoutArchive($builder)

Details

at line 21
public __construct($behavior)

Parameters

$behavior

at line 35
public string objectAttributes($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 56
public string postInsert($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 70
public string postUpdate($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 90
public string preDelete($builder)

Using preDelete rather than postDelete to allow user to retrieve related records and archive them before cascade deletion.

The actual deletion is made by the query object, so the AR class must tell
the query class to enable or disable archiveOnDelete.

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 103
public string objectMethods($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 123
public string addGetArchive($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 134
public string addArchive($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 148
public string addRestoreFromArchive($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 162
public string addPopulateFromArchive($builder)

Generates a method to populate the current AR object based on an archive object.

This method is necessary because the archive's copyInto() may include the archived_at column
and therefore cannot be used. Besides, the way autoincremented PKs are handled should be explicit.

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 175
public string addSaveWithoutArchive($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 187
public string addDeleteWithoutArchive($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder