本文整理匯總了PHP中Drupal\Core\Config\Entity\ConfigEntityInterface::getEvent方法的典型用法代碼示例。如果您正苦於以下問題:PHP ConfigEntityInterface::getEvent方法的具體用法?PHP ConfigEntityInterface::getEvent怎麽用?PHP ConfigEntityInterface::getEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\Core\Config\Entity\ConfigEntityInterface
的用法示例。
在下文中一共展示了ConfigEntityInterface::getEvent方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addContextDefinitionsFrom
/**
* Adds the configured context definitions from the config entity.
*
* Example: for a reaction rule config all context definitions of the event
* will be added.
*
* @param \Drupal\Core\Config\Entity\ConfigEntityInterface $rules_config
* The config entity.
*
* @return $this
*/
public function addContextDefinitionsFrom(ConfigEntityInterface $rules_config)
{
if ($rules_config instanceof ReactionRuleConfig) {
$event_name = $rules_config->getEvent();
// @todo Use setter injection for the service.
$event_definition = \Drupal::service('plugin.manager.rules_event')->getDefinition($event_name);
foreach ($event_definition['context'] as $context_name => $context_definition) {
$this->addContextDefinition($context_name, $context_definition);
}
}
return $this;
}