[uml] DefaultBlock

Webel module:

Package/Namespace: 

UML element type:

OOE stereotypes:

Relationships
implements [InterfaceRealization]: 
UML Diagram
Click on the UML diagram to view it in a lightbox image viewer. You may then zoom in (or just open the image in a new web browser tab using the Download Original link to view large diagrams).

UML modelling domain:

Code examples

From OoeBridge:

  /**
   * Delegate for hook_block_info();
   * 
   */
  public function block_info() {
 
    $blockSet = $this->factory()->newBlockSet();
 
    $blockSet->addBlock($this->block_current_posts());
 
    $blockSet->addBlock($this->block_demo());
 
    return $blockSet->get();
  }
 
  /**
   *
   * @var \Drupal\ooe\Block\IBlock
   */
  private $block_current_posts;
 
  /**
   *
   * @return \Drupal\ooe\Block\IBlock
   *   Lazily creates the current posts block.
   */
  protected function block_current_posts() {
    if (empty($this->block_current_posts)) {
      $this->block_current_posts = $this->factory()->newBlock(
          $this->getModule() . "_block_current_posts", $this->getModuleDisplayName() . ': Current posts');
      $this->block_current_posts
          ->setCache(BlockCacheKind::CACHE_PER_ROLE)
          ->setStatus(BlockStatusKind::ENABLED);
    }
    return $this->block_current_posts;
  }
 
  /**
   *
   * @var \Drupal\ooe\Block\IBlock
   */
  private $block_demo;
 
  /**
   *
   * @return \Drupal\ooe\Block\IBlock
   *   Lazily creates a demo block.
   */
  protected function block_demo() {
    if (empty($this->block_demo)) {
      $this->block_demo = $this->factory()->newBlock(
          $this->getModule() . "_block_demo", $this->getModuleDisplayName() . ': Demo block');
      $this->block_demo
          ->setCache(BlockCacheKind::CACHE_PER_ROLE)
          ->setRegion($this->region_sidebar_1st())
          ->setStatus(BlockStatusKind::ENABLED);
    }
    return $this->block_demo;
  }
 
  /**
   *
   * @return \Drupal\ooe\Layout\IRegion 
   *   A sidebar region. 
   */
  private $region_sidebar_1st;
 
  /**
   *
   * @return \Drupal\ooe\Layout\IRegion
   *   Lazily creates a Bartik sidebar region. 
   */
  protected function region_sidebar_1st() {
    if (empty($this->region_sidebar_1st)) {
      $this->region_sidebar_1st = $this->factory()->newRegion(BartikRegions::SIDEBAR_FIRST);
    }
    return $this->region_sidebar_1st;
  }