315f069a6196d637951369e7e4130b80e3cfcaac
[yaffs-website] / web / core / modules / node / src / Plugin / migrate / source / d6 / ViewModeBase.php
1 <?php
2
3 namespace Drupal\node\Plugin\migrate\source\d6;
4
5 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
6
7 /**
8  * A base class for migrations that require view mode info.
9  */
10 abstract class ViewModeBase extends DrupalSqlBase {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function count() {
16     return count($this->initializeIterator());
17   }
18
19   /**
20    * Get a list of D6 view modes.
21    *
22    * Drupal 6 supported the following view modes.
23    * NODE_BUILD_NORMAL = 0
24    * NODE_BUILD_PREVIEW = 1
25    * NODE_BUILD_SEARCH_INDEX = 2
26    * NODE_BUILD_SEARCH_RESULT = 3
27    * NODE_BUILD_RSS = 4
28    * NODE_BUILD_PRINT = 5
29    * teaser
30    * full
31    *
32    * @return array
33    *   The view mode names.
34    */
35   public function getViewModes() {
36     return [
37       0,
38       1,
39       2,
40       3,
41       4,
42       5,
43       'teaser',
44       'full',
45     ];
46   }
47
48 }