GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 7.x-1.x ( 9e29a0...ca9ee1 )
by Devin
07:35
created

DFHeroFPP   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 4
Bugs 0 Features 1
Metric Value
c 4
b 0
f 1
dl 0
loc 54
rs 10
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 50 2
1
<?php
2
3
/**
4
 * @file
5
 *  Migrations for Fieldable Panel Panes.
6
 */
7
8
class DFHeroFPP extends Migration {
9
10
  public function __construct($arguments) {
11
    parent::__construct($arguments);
12
    $this->description = t('Import Hero FPPs.');
13
14
    // Create a map object for tracking the relationships between source rows
15
    $this->map = new MigrateSQLMap($this->machineName,
16
      array(
17
        'UUID' => array(
18
          'type' => 'varchar',
19
          'length' => 36,
20
          'not null' => FALSE,
21
          'description' => 'The Universally Unique Identifier.',
22
        )
23
      ),
24
      array(
25
        'uuid' => array(
26
          'type' => 'varchar',
27
          'length' => 36,
28
          'not null' => FALSE,
29
          'description' => 'The Universally Unique Identifier.',
30
        )
31
      )
32
    );
33
34
    // Create a MigrateSource object.
35
    if (isset($arguments['path'])) {
36
      $import_path = $arguments['path'];
37
    }
38
    else {
39
      $import_path = drupal_get_path('module', 'df_tools_hero') . '/import/df_tools_hero.fpp.hero.csv';
40
    }
41
    $this->source = new MigrateSourceCSV($import_path, array(), array('header_rows' => 1));
42
    $this->destination = new MigrateDestinationFieldablePanelsPanes('hero', array('text_format' => 'full_html'));
43
44
    $this->addFieldMapping('field_hero_image', 'Image');
45
    $this->addFieldMapping('field_hero_image:file_replace')->defaultValue(FILE_EXISTS_REPLACE);
46
    $this->addFieldMapping('field_hero_image:source_dir')->defaultValue(dirname($import_path) . '/images');
47
    $this->addFieldMapping('field_hero_image:destination_file', 'filename');
48
49
    $this->addFieldMapping('field_hero_headline_1', 'Headline 1');
50
    $this->addFieldMapping('field_hero_headline_2', 'Headline 2');
51
    $this->addFieldMapping('field_hero_button_link', 'Button Link');
52
    $this->addFieldMapping('field_hero_button_link:title', 'Button Title');
53
54
    $this->addFieldMapping('title', 'Title');
55
    $this->addFieldMapping('uuid', 'UUID');
56
    $this->addFieldMapping('category', 'Category')->defaultValue('Reusable panes');
57
58
    $this->addFieldMapping('reusable', 'Reusable')->defaultValue(TRUE);
59
  }
60
61
}
62