DNADesign\Elemental\TopPage\SiteTreeExtension
Class SiteTreeExtension
This extension must be present on pagetypes that need to support Elemental TopPage functionality.
It can be applied directly to Page, as it only takes effect in the presence of a ElementalArea.
Synopsis
class SiteTreeExtension
extends SiteTreeExtension
{
- // members
- protected array $duplicatedPages = ;
- protected array $duplicatedObjects = ;
- // methods
- public void onAfterWrite()
- public void onBeforeDuplicate()
- public void onAfterDuplicate()
- public string|null getDuplicationKey()
- public void addDuplicatedObject()
- protected string|null getDuplicatedPageKey()
- protected void initDuplication()
- protected void processDuplication()
- protected void processDuplicationFromOriginal()
- protected void writeDuplication()
- protected void setTopPageForElementalArea()
Hierarchy
Extends
- SilverStripe\CMS\Model\SiteTreeExtension
Members
protected
- $duplicatedObjects
—
array
List of objects that need to udate their top page reference - $duplicatedPages
—
array
List of pages currently undergoing duplication
Methods
protected
- getDuplicatedPageKey() — Find currently duplicated page note: this doesn't change any stored data
- initDuplication()
- processDuplication() — Update top page reference during duplication process
- processDuplicationFromOriginal() — Relevant only for duplicated object that were not written at the time of duplication
- setTopPageForElementalArea() — Elemental area is created before related page is written so we have to set top page explicitly after page is written and the relations are available
- writeDuplication()
public
- addDuplicatedObject() — Registers the given object to receive an updated TopPage reference after the duplication operation completes, ensuring the new Page is written to the database beforehand.
- getDuplicationKey() — Generates a unique key for the page
- onAfterDuplicate() — Extension point in @see DataObject::duplicate()
- onAfterWrite() — Extension point in @see DataObject::onAfterWrite()
- onBeforeDuplicate() — Extension point in @see DataObject::duplicate()