SilverStripe\CMS\Model\VirtualPage
Virtual Page creates an instance of a page, with the same fields that the original page had, but readonly.
This allows you can have a page in mulitple places in the site structure, with different children without
duplicating the content.
Note: This Only duplicates $db fields and not the $has_one etc..
Synopsis
class VirtualPage
extends Page
{
- // members
- private static string $description = 'Displays the content of another page';
- private static string $icon_class = 'font-icon-p-virtual';
- public static $virtualFields;
- private static array $non_virtual_fields = ;
- private static array $initially_copied_fields = ;
- private static array $has_one = ;
- private static array $owns = ;
- private static array $db = ;
- private static string $table_name = 'VirtualPage';
- // methods
- public array getVirtualFields()
- public array getNonVirtualisedFields()
- public void setCopyContentFromID()
- public void ContentSource()
- public array MetaComponents()
- public void allowedChildren()
- public void syncLinkTracking()
- public bool canPublish()
- public void isPublishable()
- public void getCMSFields()
- public void onBeforeWrite()
- protected void refreshFromCopied()
- public void getSettingsFields()
- public void validate()
- public void updateImageTracking()
- public void CMSTreeClasses()
- public array getViewerTemplates()
- public mixed __get()
- public void getField()
- public bool isFieldVirtualised()
- public mixed __call()
- public bool hasField()
- public bool hasMethod()
- public string castingHelper()
- public void allMethodNames()
- public void getControllerName()
Hierarchy
Extends
- Page
Members
private
- $db
- $description
- $has_one
- $icon_class
- $initially_copied_fields — array
- $non_virtual_fields — array
- $owns
- $table_name
public
- $virtualFields
Methods
protected
- refreshFromCopied() — Copy any fields from the copied record to bootstrap /backup
public
- CMSTreeClasses()
- ContentSource()
- MetaComponents()
- __call() — Pass unrecognized method calls on to the original data object
- __get() — Allow attributes on the master page to pass through to the virtual page
- allMethodNames() — {@inheritdoc}
- allowedChildren()
- canPublish() — We can only publish the page if there is a published source page
- castingHelper() — Return the "casting helper" (a piece of PHP code that when evaluated creates a casted value object) for a field on this object.
- getCMSFields() — Generate the CMS fields from the fields from the original page.
- getControllerName() — {@inheritdoc}
- getField()
- getNonVirtualisedFields() — List of fields or properties to never virtualise
- getSettingsFields()
- getViewerTemplates() — Use the target page's class name for fetching templates - as we need to take on its appearance
- getVirtualFields() — Generates the array of fields required for the page type.
- hasField()
- hasMethod()
- isFieldVirtualised() — Check if given field is virtualised
- isPublishable() — Returns true if is page is publishable by anyone at all Return false if the source page isn't published yet.
- onBeforeWrite()
- setCopyContentFromID()
- syncLinkTracking()
- updateImageTracking()
- validate()