Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / migrate / src / Plugin / migrate / destination / EntityViewMode.php
1 <?php
2
3 namespace Drupal\migrate\Plugin\migrate\destination;
4
5 /**
6  * Provides entity view mode destination plugin.
7  *
8  * See EntityConfigBase for the available configuration options.
9  * @see \Drupal\migrate\Plugin\migrate\destination\EntityConfigBase
10  *
11  * Example:
12  *
13  * @code
14  * source:
15  *   plugin: d7_view_mode
16  * process:
17  *   mode: view_mode
18  *   label: view_mode
19  *   targetEntityType: entity_type
20  * destination:
21  *   plugin: entity:entity_view_mode
22  * @endcode
23  *
24  * This will add the results of the process ("mode", "label" and
25  * "targetEntityType") to an "entity_view_mode" entity.
26  *
27  * @MigrateDestination(
28  *   id = "entity:entity_view_mode"
29  * )
30  */
31 class EntityViewMode extends EntityConfigBase {
32
33   /**
34    * {@inheritdoc}
35    */
36   public function getIds() {
37     $ids['targetEntityType']['type'] = 'string';
38     $ids['mode']['type'] = 'string';
39     return $ids;
40   }
41
42   /**
43    * {@inheritdoc}
44    */
45   public function rollback(array $destination_identifier) {
46     $destination_identifier = implode('.', $destination_identifier);
47     parent::rollback([$destination_identifier]);
48   }
49
50 }