コード例 #1
0
 /**
  * {@inheritdocs}
  */
 public function initializeContext(Context $context)
 {
     // All contexts are passed here, only RawDKANEntityContext is allowed.
     if (!$context instanceof DKANAwareInterface) {
         return;
     }
     $context->setEntityStore($this->entityStore);
     $context->setPageStore($this->pageStore);
     // Add all parameters to the context.
     //$context->setParameters($this->parameters);
 }
コード例 #2
0
 /**
  * {@inheritdocs}
  */
 public function initializeContext(Context $context)
 {
     // All contexts are passed here, only RawTestDrupalEntityContext is allowed.
     if (!$context instanceof TestDrupalAwareInterface) {
         return;
     }
     $context->setEntityStore($this->entityStore);
     $context->setPageStore($this->pageStore);
     // Set the default contexts that should be available.
     if (isset($this->default_contexts_map) && is_array($this->default_contexts_map)) {
         $map = $context->getContextsMap();
         // Override any defaults with whatever the existing values were.
         foreach ($map as $key => $class) {
             $this->default_contexts_map[$key] = $class;
         }
         // Then update the Contexts Map
         $context->setContextsMap($this->default_contexts_map);
     }
     // Add all parameters to the context.
     //$context->setParameters($this->parameters);
 }