DNADesign\Elemental\Tasks\MigrateContentToElement
Synopsis
class MigrateContentToElement
extends BuildTask
{
- // members
- private static bool $clear_content = true;
- private static string $target_element = ElementContent::class;
- private static string $target_element_field = 'HTML';
- private static bool $publish_changes = true;
- protected string $title = 'MigrateContentToElement';
- protected object $description = 'When installing Elemental this task converts content in the $Content ' . 'field to an ElementContent;
- // methods
- public void run()
- protected bool isMigratable()
- protected ElementalArea getAreaRelationFromPage()
- protected bool shouldSkipMigration()
Hierarchy
Extends
- SilverStripe\Dev\BuildTask
Members
private
- $clear_content
—
DNADesign\Elemental\Tasks\bool
Configures if the existing content should be cleared once the migration task has completed. - $publish_changes
—
DNADesign\Elemental\Tasks\bool
Indicates that the updated page and elements should be immediately published (provided the Versioned extension is present, and the page was previously in a published state) - $target_element
—
string
The FQN of an element that will be the target of the content - $target_element_field
—
string
The name of the field on the `target_element` where the content should be placed
protected
- $description
- $title
Methods
protected
- getAreaRelationFromPage() — Extracts the relevant ElementalArea from the given page. This can be overloaded for custom page types that might prefer an alternate area to hold the migrated content
- isMigratable() — Indicates if the given page type is migratable
- shouldSkipMigration() — Assert that the given page should actually have content migrated. By default this asserts that no elements currently exist IFF the "clear_content" config is on