comparison core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
70 $definition = $this->getPluginDefinition(); 70 $definition = $this->getPluginDefinition();
71 if ($definition instanceof ContextAwarePluginDefinitionInterface) { 71 if ($definition instanceof ContextAwarePluginDefinitionInterface) {
72 return $definition->getContextDefinitions(); 72 return $definition->getContextDefinitions();
73 } 73 }
74 else { 74 else {
75 return !empty($definition['context']) ? $definition['context'] : []; 75 return !empty($definition['context_definitions']) ? $definition['context_definitions'] : [];
76 } 76 }
77 } 77 }
78 78
79 /** 79 /**
80 * {@inheritdoc} 80 * {@inheritdoc}
84 if ($definition instanceof ContextAwarePluginDefinitionInterface) { 84 if ($definition instanceof ContextAwarePluginDefinitionInterface) {
85 if ($definition->hasContextDefinition($name)) { 85 if ($definition->hasContextDefinition($name)) {
86 return $definition->getContextDefinition($name); 86 return $definition->getContextDefinition($name);
87 } 87 }
88 } 88 }
89 elseif (!empty($definition['context'][$name])) { 89 elseif (!empty($definition['context_definitions'][$name])) {
90 return $definition['context'][$name]; 90 return $definition['context_definitions'][$name];
91 } 91 }
92 throw new ContextException(sprintf("The %s context is not a valid context.", $name)); 92 throw new ContextException(sprintf("The %s context is not a valid context.", $name));
93 } 93 }
94 94
95 /** 95 /**