[uml] BlockSet

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:

This simple case demonstrates well the difference between a reverse-engineered "design(ed)" PHP Class and it's Webel analysis wrapper Component. Here the reverse-engineered BlockSet class has a UML Attribute:

-$blocks : array [1] = array() 

This is as much as PEAR's PHP UML could extract from the following PHP code and Drupal-style docs:

  /**
   * @var IBlock[]
   */
  private $blocks = array();

However, the analysis wrapper component @BlockSet can convert this into a UML Association with Property end:

-$blocks: @IBlock[*] = array();

(We could also if we wished easily override the default value 'array();' to indicate the type.)

Code examples
  /**
   * Delegate for hook_block_info();
   * 
   * IMPORTANT: this version uses an OOE IBlockSet with multiple 
   * IBlock implementations to encapsulate the block info arrays !
   */
  public function block_info() {
 
  /**
   * Delegate for the ooe_block_info() implementation of hook_block_info().
   * 
   * IMPORTANT: this version uses an OOE IBlockSet with multiple 
   * IBlock implementations to encapsulate the block info arrays !
   * 
   * @return array
   *   A block info array compatible with hook_block_info().
   */
  public function block_info() {
 
    $blockSet = $this->factory()->newBlockSet();
 
    $blockSet->addBlock($this->currentPosts()->getBlock());
 
    $blockSet->addBlock($this->demo()->getBlock());
 
    //$blockSet->addBlock($this->demoOfPageArguments()->getBlock());
    //$blockSet->addBlock($this->demoOfForms()->getBlock());
 
    return $blockSet->get();
  }
Notes (policies)