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 24
public
__construct($behavior)
at line 38
public string
objectAttributes($builder)
at line 60
public string
postInsert($builder)
at line 74
public string
postUpdate($builder)
at line 94
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.
at line 107
public string
objectMethods($builder)
at line 128
public string
addGetArchive($builder)
at line 139
public string
addArchive($builder)
at line 153
public string
addRestoreFromArchive($builder)
at line 167
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.