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)
at line 35
public string
objectAttributes($builder)
at line 56
public string
postInsert($builder)
at line 70
public string
postUpdate($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.
at line 103
public string
objectMethods($builder)
at line 123
public string
addGetArchive($builder)
at line 134
public string
addArchive($builder)
at line 148
public string
addRestoreFromArchive($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.