/** * Update all child themes relations * * @param \Magento\Framework\View\Design\ThemeInterface $themeModel * @return $this */ public function updateChildRelations(\Magento\Framework\View\Design\ThemeInterface $themeModel) { $parentThemeId = $themeModel->getParentId(); $this->addFieldToFilter('parent_id', ['eq' => $themeModel->getId()])->load(); /** @var $theme \Magento\Framework\View\Design\ThemeInterface */ foreach ($this->getItems() as $theme) { $theme->setParentId($parentThemeId)->save(); } return $this; }