Skip to content

Commit

Permalink
Merge pull request #4 from signalwerk/add-reference-import-support
Browse files Browse the repository at this point in the history
ADD support to import reference by ID
  • Loading branch information
danielkestler authored Sep 21, 2021
2 parents 664a20d + 0a00e1a commit f1232cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Classes/Controller/ImportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,12 @@ public function importAction() {
$i = 0;
foreach ($row as $col) {
if (isset($mapping[$i]) && $mapping[$i] != '___') {
$node->setProperty($mapping[$i], $col);
if ($node->getNodeType()->getPropertyType($mapping[$i]) === 'reference') {
$refNode = $q->find($col)->get(0);
$node->setProperty($mapping[$i], $refNode);
} else {
$node->setProperty($mapping[$i], $col);
}
}
$i++;
}
Expand Down

0 comments on commit f1232cb

Please sign in to comment.