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 59
public string postInsert($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 73
public string postUpdate($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 93
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 106
public string objectMethods($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 126
public string addGetArchive($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 137
public string addArchive($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 151
public string addRestoreFromArchive($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 165
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 178
public string addSaveWithoutArchive($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder

at line 190
public string addDeleteWithoutArchive($builder)

Parameters

$builder

Return Value

string the PHP code to be added to the builder