| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | public function prepareRow(Row $row) { |
||
| 18 | if ($image = $row->getSourceProperty('Picture')) { |
||
| 19 | $base_path = dirname($this->configuration['path']) . '/images/'; |
||
| 20 | |||
| 21 | // Setup our source/destination paths. |
||
| 22 | $path = $base_path . $image; |
||
| 23 | $destination_path = 'public://' . $image; |
||
| 24 | |||
| 25 | // Copy the file. |
||
| 26 | file_unmanaged_copy($path, $destination_path, FILE_EXISTS_REPLACE); |
||
| 27 | |||
| 28 | $row->setSourceProperty('filepath', $path); |
||
| 29 | $row->setDestinationProperty('uri', $destination_path); |
||
| 30 | $row->setDestinationProperty('status', 1); |
||
| 31 | } |
||
| 35 |