Wilr\SilverStripe\Tasker\Traits\TaskHelpers
Synopsis
trait TaskHelpers
{
- // methods
- public void migrateTableToExistingTable()
- public void escapeNamespace()
- public boolean hasTable()
- protected void query()
- protected void dropTable()
- protected void tableHasCol()
- public void archivePage()
- public void runInsertOrUpdate()
- public void updateFilePathLinks()
- protected void migrateDataColumnTo()
- protected void setInvalidEnumValuesTo()
- public void correctPageClass()
- protected void renameColumn()
- public void removePagesOnLiveNotOnDraft()
Methods
protected
- dropTable()
- migrateDataColumnTo() — Migrate data from a column on a table to another column on potentially another table. Automatically handles versioned and live tables.
- query()
- renameColumn()
- setInvalidEnumValuesTo() — For things like invalid values in an enum you get a blank value. Not null nor empty string '', so you basically can't pick it up. What this does is loop over all the rows in the table and sets to a default value if it's not set in PHP
- tableHasCol()
public
- archivePage() — Helper function to archive a page from the live and draft stages. The CMS was full of dodgy old pages which cluttered things up. The test site should be used for experimenting, not production!
- correctPageClass() — Corrects a particular page class name
- escapeNamespace()
- hasTable() — Returns whether a table exists
- migrateTableToExistingTable() — Copies the data from an old subclass table into the new class table.
- removePagesOnLiveNotOnDraft() — Archive any pages that have been orphaned
- runInsertOrUpdate() — Runs an INSERT or UPDATE query on the provided table depending on if a record with the ID matches.
- updateFilePathLinks() — Corrects broken file paths