NSWDPC\Utilities\Cloudflare\DataObjectPurgeable
Extension that decorates a purgeable dataobject, currently support URLs only
- Author: james.ellis@dpc.nsw.gov.au
Synopsis
class DataObjectPurgeable
extends DataExtension
implements
CloudflarePurgeable
{
- // constants
- const REASON_WRITE = 'write';
- const REASON_DELETE = 'delete';
- const REASON_PUBLISH = 'publish';
- const REASON_UNPUBLISH = 'unpublish';
- // members
- private static array $db = ;
- // methods
- public void onBeforeWrite()
- public void onBeforeDelete()
- public void onAfterPublish()
- public void onAfterUnpublish()
- public void updateCMSFields()
- public array getPurgeTypes()
- public void getPurgeRecordName()
- public final array getPurgeValues()
- public array getPurgeTypeValues()
- private void clearCurrentJobs()
- public void getCurrentPurgeJobDescriptors()
- public AbstractRecordCachePurgeJob|false getJobClassForType()
- public array getPurgeJobs()
- public final array|false createPurgeJobs()
Hierarchy
Constants
Name | Value |
---|---|
REASON_WRITE | 'write' |
REASON_DELETE | 'delete' |
REASON_PUBLISH | 'publish' |
REASON_UNPUBLISH | 'unpublish' |
Members
private
- $db
Methods
private
public
- createPurgeJobs() — Create a purge URL job for the record Returns an array of QueuedJob instances queued successfull (not QueuedJobDescriptor) or false on error
- getCurrentPurgeJobDescriptors() — Return QueuedJobDescriptor records linked to the owner record
- getJobClassForType() — Attempt to return an instance of the job related to the Task
- getPurgeJobs() — Based on the purge values returned for this record, create jobs to assist with record purging
- getPurgeRecordName() — The name of the record for usage in QueuedJobs
- getPurgeTypeValues() — Only the record knows which values to return for the given type For the moment, return URLs that can be purged
- getPurgeTypes() — Only the record knows which types to return, but return URL type here as the default Owner records will take precedence
- getPurgeValues() — Return an array of values that can be purged
- onAfterPublish() — After publish, create any purge jobs that should be fired for the 'publish' reason For versioned records when they are published
- onAfterUnpublish() — After unpublish, create any purge jobs that should be fired for the 'unpublish' reason For versioned records when the Live stage record is removed
- onBeforeDelete() — Prior to delete, remove any pending jobs for this record Allows the afterDelete to create the correct job(s)
- onBeforeWrite() — Prior to write, remove any pending jobs for this record Allows the afterDelete to create the correct job(s)
- updateCMSFields()