Exemplo n.º 1
0
 /**
  * @test
  * @testdox Can construct with identity and access it externally
  */
 public function contextCanBeConstructWithIdentity()
 {
     $context = new RegionContext('some-id', 'default', 'default');
     $this->assertEquals('some-id', $context->getIdentity());
     $this->assertEquals('default', $context->getRendererIdentity());
     $this->assertEquals('default', $context->getLoaderIdentity());
 }
Exemplo n.º 2
0
 public function addRegionContext(RegionContext $context)
 {
     //  If pooling is disabled then we should request the context be populated instantly.
     //  When pooling is enabled we delegate the request to a batch method on first render.
     if (!$this->pooling && !isset($this->regionContexts[$context->getIdentity()])) {
         $this->loadRegionContext($context);
     }
     //  Do not override contexts, instead check if the context has not been listed.
     if (!isset($this->regionContexts[$context->getIdentity()])) {
         $this->regionContexts[$context->getIdentity()] = $context;
     }
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function single(RegionContext $context)
 {
     $context->setData(sprintf('%s-data', $context->getIdentity()));
 }