\PublishableObject
An extension to abstract some of the functionality around publishing, for objects that aren't extended from SiteTree
- Author: Marcus Nyeholt <marcus@silverstripe.com.au>
Synopsis
class PublishableObject
extends Versioned
{
- // members
- private static array $db = ;
- // methods
- public static array get_extra_config()
- public void __construct()
- public void onBeforeWrite()
- public boolean canPublish()
- public void onBeforePublish()
- public void onAfterPublish()
- public <type> doPublish()
- public void doUnpublish()
- public boolean isNew()
- public boolean getIsDeletedFromStage()
- public void getExistsOnLive()
- public boolean getIsModifiedOnStage()
- public boolean getIsAddedToStage()
Hierarchy
Extends
- Versioned
Members
private
- $db
Methods
public
- __construct()
- canPublish() — Taken from SiteTree
- doPublish() — Modified version of the SiteTree publish method.
- doUnpublish()
- getExistsOnLive() — Return true if this page exists on the live site
- getIsAddedToStage() — Compares current draft with live version, and returns true if no live version exists, meaning the page was never published.
- getIsDeletedFromStage() — Compares current draft with live version, and returns TRUE if no draft version of this page exists, but the page is still published (after triggering "Delete from draft site" in the CMS).
- getIsModifiedOnStage() — Compares current draft with live version, and returns TRUE if these versions differ, meaning there have been unpublished changes to the draft site.
- get_extra_config()
- isNew() — Check if this page is new - that is, if it has yet to have been written to the database.
- onAfterPublish()
- onBeforePublish()
- onBeforeWrite()