| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) { |
||
| 22 | $split = explode(':node/', $value); |
||
| 23 | if (isset($split[1])) { |
||
| 24 | $nodes = \Drupal::entityTypeManager() |
||
| 25 | ->getStorage('node') |
||
| 26 | ->loadByProperties(['uuid' => $split[1]]); |
||
| 27 | if (!empty($nodes)) { |
||
| 28 | reset($nodes); |
||
| 29 | $nid = key($nodes); |
||
| 30 | $value = str_replace($split[1], $nid, $value); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | return $value; |
||
| 34 | } |
||
| 35 | |||
| 37 |