public function setRegionBlock($config_name, $region_name, Block $block = NULL) { if (!isset($this->page_configuration_map[$config_name])) { throw new e\NoSuchPageConfigurationException(S_SPAN . "Path: " . $this->getPath() . E_SPAN . BR . "The page configuration {$config_name} does not exist."); } if (self::DEBUG) { u\DebugUtility::out("Setting block to region" . BR . "Region name: " . $region_name); if (isset($block)) { u\DebugUtility::out("Block ID: " . $block->getId()); } else { u\DebugUtility::out("No block passed in."); } } $this->page_configuration_map[$config_name]->setRegionBlock($region_name, $block); return $this; }
public function setBlock(a\Block $block = NULL) { if (self::DEBUG) { u\DebugUtility::out("setBlock called: " . $block->getId()); } // required if ($this->required && $block == NULL) { throw new e\EmptyValueException(S_SPAN . c\M::NULL_BLOCK . E_SPAN); } if ($this->asset_type != c\T::BLOCK) { throw new e\NodeException(S_SPAN . "The asset does not accept a block." . E_SPAN); } if (isset($block)) { $this->block_id = $block->getId(); $this->block_path = $block->getPath(); } else { $this->block_id = NULL; $this->block_path = NULL; } return $this; }