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 59
public string
postInsert($builder)
at line 73
public string
postUpdate($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.
at line 106
public string
objectMethods($builder)
at line 126
public string
addGetArchive($builder)
at line 137
public string
addArchive($builder)
at line 151
public string
addRestoreFromArchive($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.