WorkflowEmbargoExpiryExtension
class WorkflowEmbargoExpiryExtension extends Extension (View source)
Adds embargo period and expiry dates to content items
Properties
protected | T | $owner | The object this extension is applied to. |
from Extension |
protected | WorkflowService | $workflowService | ||
public | bool | $isWorkflowInEffect | Is a workflow in effect? |
|
public static | array | $extendedMethodReturn | A basic extended validation routine method return format |
Methods
Called when this extension is added to a particular class
Temporarily modify the owner. The original owner is ensured to be restored
Clear the current owner, and restore extension to the state prior to the last setOwner()
Helper method to strip eval'ed arguments from a string that's passed to DataObject::$extensions or Object::add_extension().
Invoke extension point. This will prefer explicit extend
prefixed
methods.
Ensure the existence of an unpublish job at the specified time
Add badges to the site tree view to show that a page has been scheduled for publishing or unpublishing
Define an array of message-parts for use by getIntroMessage()
Display some messages to the user, a little more complex that a simple one-liner
This is called in the AWRequiredFieldsValidator class, this validates whether an Embargo and Expiry are not equal and that Embargo is before Expiry, returning the appropriate message when it fails.
Returns whether a publishing date has been set and is after the current date
Returns whether an unpublishing date has been set and is after the current date
Details
__construct()
No description
static
add_to_class(string $class, string $extensionClass, mixed $args = null)
Called when this extension is added to a particular class
setOwner(object $owner)
Set the owner of this extension.
mixed
withOwner(mixed $owner, callable $callback, array $args = [])
Temporarily modify the owner. The original owner is ensured to be restored
clearOwner()
Clear the current owner, and restore extension to the state prior to the last setOwner()
T
getOwner()
Returns the owner of this extension.
static string
get_classname_without_arguments(string $extensionStr)
Helper method to strip eval'ed arguments from a string that's passed to DataObject::$extensions or Object::add_extension().
mixed
invokeExtension(object $owner, string $method, array ...$arguments)
Invoke extension point. This will prefer explicit extend
prefixed
methods.
protected
updateCMSFields(FieldList $fields)
No description
clearPublishJob()
Clears any existing publish job against this dataobject
clearUnPublishJob()
Clears any existing unpublish job
protected
ensurePublishJob(int $when)
Ensure the existence of a publish job at the specified time
protected
ensureUnPublishJob(int $when)
Ensure the existence of an unpublish job at the specified time
protected
onBeforeDuplicate($original, $doWrite)
No description
protected
onBeforeWrite()
{PublishItemWorkflowAction} for approval of requested publish dates
protected
updateStatusFlags($flags)
Add badges to the site tree view to show that a page has been scheduled for publishing or unpublishing
array
getIntroMessageParts(string $key)
Define an array of message-parts for use by getIntroMessage()
string
getIntroMessage(string $key)
Display some messages to the user, a little more complex that a simple one-liner
protected void
updateCMSCompositeValidator(CompositeValidator $validator)
No description
array
extendedRequiredFieldsEmbargoExpiry($data)
This is called in the AWRequiredFieldsValidator class, this validates whether an Embargo and Expiry are not equal and that Embargo is before Expiry, returning the appropriate message when it fails.
string
getUserDate(string $date)
Format a date according to member/user preferences
setIsWorkflowInEffect()
No description
getIsWorkflowInEffect()
No description
bool
getIsPublishScheduled()
Returns whether a publishing date has been set and is after the current date
bool
getIsUnPublishScheduled()
Returns whether an unpublishing date has been set and is after the current date
protected bool|null
canEdit(Member $member)
Add edit check for when publishing has been scheduled and if any workflow definitions want the item to be disabled.
$this
setWorkflowService(WorkflowService $workflowService)
Set the workflow service instance
WorkflowService
getWorkflowService()
Get the workflow service instance
QueuedJobDescriptor
PublishJob()
No description
QueuedJobDescriptor
UnPublishJob()
No description