SilverStripe\Versioned\ChangeSet
The ChangeSet model tracks several VersionedAndStaged objects for later publication as a single atomic action
Synopsis
class ChangeSet
extends DataObject
{
- // constants
- const STATE_OPEN = 'open';
- const STATE_REVERTED = 'reverted';
- const STATE_PUBLISHED = 'published';
- // members
- private static string $singular_name = 'Campaign';
- private static string $plural_name = 'Campaigns';
- private static string $table_name = 'ChangeSet';
- private static array $db = ;
- private static array $has_many = ;
- private static array $defaults = ;
- private static array $has_one = ;
- private static array $casting = ;
- private static string $default_sort = '"ChangeSet"."State" ASC, "ChangeSet"."ID" ASC';
- private static array $important_classes = ;
- private static array $summary_fields = ;
- private static array $required_permission = ;
- // methods
- public bool publish()
- public void addObject()
- public void removeObject()
- protected string implicitKey()
- protected array calculateImplicit()
- public void sync()
- public void isSynced()
- public void canView()
- public void canEdit()
- public void canCreate()
- public void canDelete()
- public bool canPublish()
- public bool hasChanges()
- public bool canRevert()
- public bool can()
- public void getCMSFields()
- public string getDetails()
- public int getChangesCount()
- public string getPublishedLabel()
- public string getStateLabel()
- public string getPublisherName()
- public array fieldLabels()
- public void provideI18nEntities()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Constants
Name | Value |
---|---|
STATE_OPEN | 'open' |
STATE_REVERTED | 'reverted' |
STATE_PUBLISHED | 'published' |
Members
private
- $casting
- $db
- $default_sort
- $defaults
- $has_many
- $has_one
- $important_classes
—
array
List of classes to set apart in description - $plural_name
- $required_permission
—
array
Default permission to require for publishers. - $singular_name
- $summary_fields
- $table_name
Methods
protected
- calculateImplicit() — List of all implicit items inferred from all currently assigned explicit changes
- implicitKey() — Build identifying string key for this object
public
- addObject() — Add a new change to this changeset. Will automatically include all owned changes as those are dependencies of this item.
- can() — Default permissions for this changeset
- canCreate()
- canDelete()
- canEdit()
- canPublish() — Check if this item is allowed to be published
- canRevert() — Check if this changeset (if published) can be reverted
- canView()
- fieldLabels()
- getCMSFields()
- getChangesCount() — Required to support the "changes" count display in react gridfield column
- getDetails() — Gets summary of items in changeset
- getPublishedLabel() — Gets the label for the "last published" date. Special case for "today"
- getPublisherName() — Gets the full name of the user who last published this campaign
- getStateLabel() — Description for state
- hasChanges() — Determine if there are changes to publish
- isSynced() — Verify that any objects in this changeset include all owned changes
- provideI18nEntities()
- publish() — Publish this changeset, then closes it.
- removeObject() — Remove an item from this changeset. Will automatically remove all changes which own (and thus depend on) the removed item.
- sync() — Add implicit changes that should be included in this changeset