trash
Moves content to the trash, restores it from the trash, or purges it for good.
A step of a YAML migration with type: trash. The class expMigrationStepTrash (kernel/classes/migration/steps/expmigrationsteptrash.php) is registered in settings/migration.ini [StepSettings] StepTypeList[trash].
Modes
mode: is one of move, restore, purge; every step names one.
Keys
| Key | Type | Modes | Default | What it is |
|---|---|---|---|---|
object | identifier (object) | all | the object: move puts it in the trash; restore and purge take it from there (its id or remote:<remote id>) | |
node | identifier (node) | move | a node of the object that goes to the trash (or object:) | |
parent | identifier (node) | restore | the node a restored object is placed below (default: the parent it had, when it is still there) | |
all | bool | purge | false | true: the whole trash is emptied (instead of object:) |
missing | string: fail, skip | all | "fail" | what happens when the object is not there (move) or not in the trash (restore, purge): fail (the default) or skip |
workflows | bool | move, restore | false | true: the workflows of the operation's triggers run, as in the administration (default: they do not) |
Besides these, every step takes the keys of the engine: type, mode, if, references, environments, engines and comment (the file format). A key of type identifier names a node, an object or another part of the installation by id, remote id, path or name (identifiers).
Values for references
references: { <name>: <value> } keeps a value of the step's result as ${ref.<name>} for the steps and migrations after it:
| Value | What it is |
|---|---|
object_id | the id of the object |
remote_id | its remote id |
name | its name |
node_id | its main node after a restore (null otherwise) |
purged | how many objects a purge removed |
changed | true when the step changed something |
Undoing
Some steps of this type undo themselves when their migration is rolled back without down: (the class says which); a migration with any other step of it needs down: or a rollback to its caption.
Caches it touches (cleared after the run): content.
Example
- type: trash
mode: move
node: "path:news/old-article"
- type: trash
mode: restore
object: remote:old-article
parent: "path:archive"Related
Generated by ./console exp:help:examples from settings/migration.ini, kernel/classes/migration/steps/expmigrationsteptrash.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.