X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FCore%2FPlugin%2FContext%2FContextProviderInterface.php;h=3083bc964c832aa37ca0c620bd59fef10b4f7ae0;hb=refs%2Fheads%2Fd864;hp=77075e8ce91f9ef7809c806666af942fbd17df88;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/lib/Drupal/Core/Plugin/Context/ContextProviderInterface.php b/web/core/lib/Drupal/Core/Plugin/Context/ContextProviderInterface.php index 77075e8ce..3083bc964 100644 --- a/web/core/lib/Drupal/Core/Plugin/Context/ContextProviderInterface.php +++ b/web/core/lib/Drupal/Core/Plugin/Context/ContextProviderInterface.php @@ -27,7 +27,7 @@ interface ContextProviderInterface { * $node = ... * * // Set that specific node as the value of the 'node' context. - * $context = new Context(new ContextDefinition('entity:node'), $node); + * $context = EntityContext::fromEntity($node); * return ['node' => $context]; * @endcode * @@ -62,7 +62,7 @@ interface ContextProviderInterface { * // can be configured to use it. When the plugin, for example a block, * // needs to evaluate the context, the value of this context will be * // supplied by getRuntimeContexts(). - * $context = new Context(new ContextDefinition('entity:node')); + * $context = EntityContext::fromEntityTypeId('node'); * return ['node' => $context]; * @endcode *