本文整理匯總了PHP中Magento\Framework\View\Design\ThemeInterface::getParentTheme方法的典型用法代碼示例。如果您正苦於以下問題:PHP ThemeInterface::getParentTheme方法的具體用法?PHP ThemeInterface::getParentTheme怎麽用?PHP ThemeInterface::getParentTheme使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Framework\View\Design\ThemeInterface
的用法示例。
在下文中一共展示了ThemeInterface::getParentTheme方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getPhysicalTheme
/**
* Get 'physical' theme
*
* @return \Magento\Framework\View\Design\ThemeInterface
*/
public function getPhysicalTheme()
{
/** @var $parentTheme \Magento\Framework\View\Design\ThemeInterface */
$parentTheme = $this->_theme->getParentTheme();
while ($parentTheme && !$parentTheme->isPhysical()) {
$parentTheme = $parentTheme->getParentTheme();
}
if (!$parentTheme || !$parentTheme->getId()) {
return null;
}
return $parentTheme;
}
示例2: __construct
/**
* @param \Magento\Framework\View\DesignInterface $design
* @param \Magento\Framework\Filesystem $filesystem
* @param \Magento\Framework\Event\ManagerInterface $eventDispatcher
* @param \Magento\Framework\View\ConfigInterface $viewConfig
* @param \Magento\DesignEditor\Model\Config\Control\AbstractControl $configuration
* @param \Magento\Framework\View\Design\ThemeInterface $theme
* @param \Magento\Framework\View\Design\ThemeInterface $parentTheme
*/
public function __construct(\Magento\Framework\View\DesignInterface $design, \Magento\Framework\Filesystem $filesystem, \Magento\Framework\Event\ManagerInterface $eventDispatcher, \Magento\Framework\View\ConfigInterface $viewConfig, \Magento\DesignEditor\Model\Config\Control\AbstractControl $configuration = null, \Magento\Framework\View\Design\ThemeInterface $theme = null, \Magento\Framework\View\Design\ThemeInterface $parentTheme = null)
{
$this->_configuration = $configuration;
$this->_theme = $theme;
$this->_parentTheme = $parentTheme ?: $theme->getParentTheme();
$this->_design = $design;
$this->_filesystem = $filesystem;
$this->_eventDispatcher = $eventDispatcher;
$this->_viewConfigLoader = $viewConfig;
$this->_initViewConfigs()->_loadControlsData();
}
示例3: updateFromStagingTheme
/**
* Copy changes from 'staging' theme
*
* @return \Magento\Framework\View\Design\Theme\Domain\StagingInterface
*/
public function updateFromStagingTheme()
{
$this->_themeCopyService->copy($this->_theme, $this->_theme->getParentTheme());
return $this;
}
示例4: getParentConfigs
/**
* Recursively add parent theme configs
*
* @param ThemeInterface $theme
* @param array $iterator
* @param int $index
* @return array
*/
private function getParentConfigs(ThemeInterface $theme, array $iterator, $index = 0)
{
if ($theme->getParentTheme() && $theme->isPhysical()) {
$parentDesignPath = $this->resolver->resolve(RulePool::TYPE_FILE, 'etc/view.xml', $this->area, $theme->getParentTheme());
$parentDom = new \DOMDocument();
$parentDom->load($parentDesignPath);
$iterator[$index] = $parentDom->saveXML();
$iterator = $this->getParentConfigs($theme->getParentTheme(), $iterator, ++$index);
}
return $iterator;
}
示例5: _getResetParentId
/**
* Reset parent themes by type
*
* @param ThemeInterface $theme
* @return int|null
*/
protected function _getResetParentId(ThemeInterface $theme)
{
$parentTheme = $theme->getParentTheme();
while ($parentTheme) {
foreach ($this->_allowedRelations as $typesSequence) {
list($parentType, $childType) = $typesSequence;
if ($theme->getType() == $childType && $parentTheme->getType() == $parentType) {
return $parentTheme->getId();
}
}
$parentTheme = $parentTheme->getParentTheme();
}
return null;
}