本文整理匯總了PHP中Drupal\Core\Entity\EntityStorageInterface::getReplacementId方法的典型用法代碼示例。如果您正苦於以下問題:PHP EntityStorageInterface::getReplacementId方法的具體用法?PHP EntityStorageInterface::getReplacementId怎麽用?PHP EntityStorageInterface::getReplacementId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\Core\Entity\EntityStorageInterface
的用法示例。
在下文中一共展示了EntityStorageInterface::getReplacementId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onDependencyRemoval
/**
* {@inheritdoc}
*/
public function onDependencyRemoval(array $dependencies)
{
$changed = parent::onDependencyRemoval($dependencies);
$style_id = $this->getSetting('image_style');
if ($style_id && ($style = ImageStyle::load($style_id))) {
if (!empty($dependencies[$style->getConfigDependencyKey()][$style->getConfigDependencyName()])) {
$replacement_id = $this->imageStyleStorage->getReplacementId($style_id);
// If a valid replacement has been provided in the storage, replace the
// image style with the replacement and signal that the formatter plugin
// settings were updated.
if ($replacement_id && ImageStyle::load($replacement_id)) {
$this->setSetting('image_style', $replacement_id);
$changed = TRUE;
}
}
}
return $changed;
}