Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | public function __construct($arguments) { |
||
10 | parent::__construct($arguments); |
||
11 | $this->map = new MigrateSQLMap($this->machineName, |
||
12 | array( |
||
13 | 'image' => array( |
||
14 | 'type' => 'varchar', |
||
15 | 'length' => 255, |
||
16 | 'not null' => TRUE, |
||
17 | ), |
||
18 | ), |
||
19 | MigrateDestinationFile::getKeySchema() |
||
20 | ); |
||
21 | $this->destination = new MigrateDestinationFile('image'); |
||
22 | $import_path = drupal_get_path('module', 'dfs_med') . '/import/'; |
||
23 | $this->source = new MigrateSourceCSV($import_path . 'dfs_med.files.image.csv', $this->csvcolumns(), array('header_rows' => 1)); |
||
24 | $this->addFieldMapping('value', 'image'); |
||
25 | $this->addFieldMapping('file_replace')->defaultValue(FILE_EXISTS_REPLACE); |
||
26 | $this->addFieldMapping('source_dir')->defaultValue($import_path . 'images'); |
||
27 | $this->addFieldMapping('destination_file', 'image'); |
||
28 | } |
||
29 | |||
37 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.