object_state_group
Creates, updates, ensures or deletes an object state group with its states and the translations of their names.
A step of a YAML migration with type: object_state_group. The class expMigrationStepObjectStateGroup (kernel/classes/migration/steps/expmigrationstepobjectstategroup.php) is registered in settings/migration.ini [StepSettings] StepTypeList[object_state_group].
Modes
mode: is one of create, update, ensure, delete; every step names one.
Keys
| Key | Type | Modes | Default | What it is |
|---|---|---|---|---|
group | identifier (state_group) | update, delete | the group to update or delete: its identifier or id | |
identifier | string | create, update, ensure | the identifier of the group; ensure finds the group by it (update: a new identifier) | |
language | string | create, update, ensure | the language of name: (default: the default language of content, ContentObjectLocale) | |
name | string | create, update, ensure | the name of the group in the language of language: | |
names | map | create, update, ensure | language => the name of the group in it: its translations | |
description | string | create, update, ensure | the description of the group in the language of language: | |
descriptions | map | create, update, ensure | language => the description of the group in it | |
states | list | create, ensure | the states, each a map: identifier, name, names, description, descriptions; ensure adds the missing ones and changes what differs | |
add_states | list | update | states to add, as in states: | |
update_states | map | update | state identifier => what changes (name, names, description, descriptions, identifier for a new one) | |
remove_states | list | update | the identifiers of states to remove; their objects get the first state left | |
missing | string: fail, skip | update, delete | "fail" | what happens when the group is not there: fail (the default) or skip |
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 |
|---|---|
group_id | the id of the group |
identifier | its identifier |
state_ids | state identifier => id, for every state of the group |
created | true when the step created the group |
changed | true when the step changed it (created, updated or deleted) |
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): state_limitations, user_info_cache, content.
Example
- type: object_state_group
mode: ensure
identifier: review
name: Review
names: { ger-DE: Prüfung }
states:
- { identifier: draft, name: Draft, names: { ger-DE: Entwurf } }
- { identifier: approved, name: Approved }Related
Generated by ./console exp:help:examples from settings/migration.ini, kernel/classes/migration/steps/expmigrationstepobjectstategroup.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.