\ChangesetTrackable
An extension that makes an object's changes trackable in a changeset along with other content that was changed at the same time. Objects must have the 'versionable' aspect applied.
- Author: Marcus Nyeholt <marcus@silverstripe.com.au>
Synopsis
class ChangesetTrackable
extends DataExtension
{
- // members
- public static array $dependencies = ;
- public ContentChangeset $changesetService;
- private A $publishingViaChangeset = false;
- protected boolean $lockedBy = false;
- // methods
- public void __construct()
- public void setPublishingViaChangeset()
- public void lockedBy()
- public boolean canBeLocked()
- public void lockType()
- public ContentChangeset getCurrentChangeset()
- public DataObjectSet Changesets()
- public String getChangeType()
- public void onAfterWrite()
- public void addToChangeset()
- public void canPublish()
- public void canDeleteFromLive()
- public void canEdit()
- public void onAfterPublish()
- public void onAfterDelete()
Hierarchy
Extends
- DataExtension
Members
private
- $publishingViaChangeset — A
protected
-
$lockedBy
Who is this obect locked by?
public
- $changesetService — ContentChangeset
- $dependencies
Methods
public
- __construct()
- Changesets() — Get all the changesets that this page is in currently and historically
- addToChangeset() — Add this item into a particular changeset
- canBeLocked() — Indicates whether this page can be locked
- canDeleteFromLive() — Cannot directly delete an object from live - it must be deleted from draft, then have the change pushed through as part of a changeset submission
- canEdit() — Can only edit content that's NOT in another person's content changeset
- canPublish() — Before content is published, lets see whether or not the item is the only piece of content in the current changeset - if it is, then we'll let it go, otherwise we'll prevent publication.
- getChangeType() — Returns a string indicating the type of change that this was
- getCurrentChangeset() — Get the current changeset that this is associated with
- lockType() — What is the lock applied to this page?
- lockedBy() — Indicates who this change set is locked by
- onAfterDelete() — If something is deleted, make sure to track that it has been so that we can unpublish it later also
- onAfterPublish() — After an item is published, lets check to see whether the publication was part of the changeset publication process (canPublish flag will be true).
- onAfterWrite() — Before writing content, add it into the user's current changeset if it isn't already
- setPublishingViaChangeset() — An instance method that sets temporarily that this object can be published.