Skip to content

Commit f21afd3

Browse files
committed
Update appTheme.php
1 parent f1a903c commit f21afd3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

appTheme.php

+14
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public function launch()
1919
$this->setType($id);
2020
}
2121

22+
// $this->setParent(5, 4);
23+
//
2224
// $themesCollections = $this->_objectManager->create('Magento\Theme\Model\Theme\Collection');
2325
// $themesCollections->addConstraint(Collection::CONSTRAINT_AREA, Area::AREA_FRONTEND);
2426
// $themes = [];
@@ -84,6 +86,18 @@ public function setType($id)
8486
}
8587
}
8688

89+
public function setParent($id, $parentId)
90+
{
91+
$theme = $this->_objectManager->create('Magento\Theme\Model\Theme');
92+
try {
93+
$theme->load($id, 'theme_id');
94+
$theme->setData('parent_id', $parentId);
95+
$theme->save();
96+
echo 'done';
97+
} catch (\Exception $e) {
98+
$this->messageManager->addError(__('Can\'t create child theme error "%1"', $e->getMessage()));
99+
}
100+
}
87101

88102
}
89103

0 commit comments

Comments
 (0)