TimestampTriggers
class TimestampTriggers
Build a set of SQL triggers for tracking timestamps on an entity.
This class is a generalization of CRM-10554 with the aim of enabling CRM-20958.
Methods
No description
TimestampTriggers constructor.
Add our list of triggers to the global list.
Generate triggers to update the timestamp.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Get a list of all tracked relations.
Details
at line 84
static TimestampTriggers
create(string $tableName, string $customDataEntity)
at line 106
__construct(string $tableName, string $customDataEntity, string $createdDate = 'created_date', string $modifiedDate = 'modified_date', array $relations = [])
TimestampTriggers constructor.
at line 126
onTriggerInfo(GenericHookEvent $e)
Add our list of triggers to the global list.
at line 141
alterTriggerInfo(array $info, string|NULL $tableFilter = NULL)
Add our list of triggers to the global list.
at line 192
generateTimestampTriggers(array $info, string|null $tableFilter, array $relatedTableNames, string $contactRefColumn)
Generate triggers to update the timestamp.
The corresponding civicrm_FOO row is updated on insert/update/delete to a table that extends civicrm_FOO. Don't regenerate triggers for all such tables if only asked for one table.
at line 228
string
getTableName()
at line 236
TimestampTriggers
setTableName(string $tableName)
at line 244
string
getCustomDataEntity()
at line 252
TimestampTriggers
setCustomDataEntity(string $customDataEntity)
at line 260
string
getCreatedDate()
at line 268
TimestampTriggers
setCreatedDate(string $createdDate)
at line 276
string
getModifiedDate()
at line 284
TimestampTriggers
setModifiedDate(string $modifiedDate)
at line 293
array
getRelations()
at line 301
TimestampTriggers
setRelations(array $relations)
at line 314
array
getAllRelations()
Get a list of all tracked relations.
This is basically the curated list ($this->relations
) plus any custom data.