/** * Initialize the object * * @param \ParticipationModel $objConfig */ public function __construct($objConfig) { parent::__construct(); if ($objConfig instanceof \Model) { $this->objModel = $objConfig; } elseif ($objConfig instanceof \Model\Collection) { $this->objModel = $objConfig->current(); } $this->arrData = $objConfig->row(); \Controller::loadDataContainer($objConfig->type); \Controller::loadLanguageFile('default'); $this->strTable = $objConfig->type; $this->ptable = $GLOBALS['TL_DCA'][$this->strTable]['config']['ptable']; $this->ctable = $GLOBALS['TL_DCA'][$this->strTable]['config']['ctable']; }
/** * Initialize the object * * @param \ParticipationModel $objParticipation */ public function __construct($objParticipation) { parent::__construct(); if ($objParticipation instanceof \Model) { $this->objParticipation = $objParticipation; } elseif ($objParticipation instanceof \Model\Collection) { $this->objParticipation = $objParticipation->current(); } $this->objParticipationArchive = $this->objParticipation->getRelated('pid'); $this->arrData = $objParticipation->row(); \Controller::loadDataContainer($objParticipation->targetType); \Controller::loadLanguageFile('default'); $this->strTable = $objParticipation->targetType; $this->ptable = $GLOBALS['TL_DCA'][$this->targetType]['config']['ptable']; $this->ctable = $GLOBALS['TL_DCA'][$this->targetType]['config']['ctable']; }