/** * Initialize the object * * @param \ModuleModel $objModule * @param string $strColumn */ public function __construct($objModule, $strColumn = 'main') { if ($objModule instanceof \Model) { $this->objModel = $objModule; } elseif ($objModule instanceof \Model\Collection) { $this->objModel = $objModule->current(); } parent::__construct(); $this->arrData = $objModule->row(); $this->space = deserialize($objModule->space); $this->cssID = deserialize($objModule->cssID, true); if ($this->customTpl != '' && TL_MODE == 'FE') { $this->strTemplate = $this->customTpl; } $arrHeadline = deserialize($objModule->headline); $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline; $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1'; $this->strColumn = $strColumn; }
/** * Initialize the object * * @param ModuleModel $objModule * @param string $strColumn */ public function __construct($objModule, $strColumn = 'main') { if ($objModule instanceof Model || $objModule instanceof Model\Collection) { /** @var ModuleModel $objModel */ $objModel = $objModule; if ($objModel instanceof Model\Collection) { $objModel = $objModel->current(); } $this->objModel = $objModel; } parent::__construct(); $this->arrData = $objModule->row(); $this->cssID = \StringUtil::deserialize($objModule->cssID, true); if ($this->customTpl != '' && TL_MODE == 'FE') { $this->strTemplate = $this->customTpl; } $arrHeadline = \StringUtil::deserialize($objModule->headline); $this->headline = is_array($arrHeadline) ? $arrHeadline['value'] : $arrHeadline; $this->hl = is_array($arrHeadline) ? $arrHeadline['unit'] : 'h1'; $this->strColumn = $strColumn; }