本文整理汇总了PHP中Drupal\Component\Plugin\PluginManagerInterface::getFallbackPluginId方法的典型用法代码示例。如果您正苦于以下问题:PHP PluginManagerInterface::getFallbackPluginId方法的具体用法?PHP PluginManagerInterface::getFallbackPluginId怎么用?PHP PluginManagerInterface::getFallbackPluginId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\Component\Plugin\PluginManagerInterface
的用法示例。
在下文中一共展示了PluginManagerInterface::getFallbackPluginId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: transform
/**
* {@inheritdoc}
*/
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property)
{
$plugin_id = parent::transform($value, $migrate_executable, $row, $destination_property);
// If the static map is bypassed on failure, the returned plugin ID will be
// an array if $value was. Plugin IDs cannot be arrays, so flatten it before
// passing it into the filter manager.
if (is_array($plugin_id)) {
$plugin_id = implode(':', $plugin_id);
}
if ($this->filterManager->hasDefinition($plugin_id)) {
return $plugin_id;
} else {
$fallback = $this->filterManager->getFallbackPluginId($plugin_id);
$message = $this->t('Filter @plugin_id could not be mapped to an existing filter plugin; defaulting to @fallback.', ['@plugin_id' => $plugin_id, '@fallback' => $fallback]);
$migrate_executable->saveMessage((string) $message, MigrationInterface::MESSAGE_WARNING);
return $fallback;
}
}