Skip to content

Commit 8d871e0

Browse files
authored
feat: support nested customer objects (#566)
1 parent e491668 commit 8d871e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/CustomerProvider/ObjectNamingScheme/DefaultObjectNamingScheme.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ public function apply(CustomerInterface $customer)
7676

7777
$parentPath = $this->correctPath($parentPath);
7878

79-
$customer->setParent(Service::createFolderByPath($parentPath));
79+
if ($parent = Service::getElementByPath('object', $parentPath)) {
80+
$customer->setParent($parent);
81+
} else {
82+
$customer->setParent(Service::createFolderByPath($parentPath));
83+
}
8084

8185
if (!$customer->getKey()) {
8286
$customer->setKey(uniqid());

0 commit comments

Comments
 (0)