public function compile() { if ($this->personID > 0) { $objPerson = \PersonModel::findByPk($this->personID); $arrSize = deserialize($this->size); if ($objPerson) { $arrData = $this->getArrayOfPerson($objPerson, $arrSize); foreach ($arrData as $strName => $strValue) { $this->Template->{$strName} = $strValue; } \Controller::addImageToTemplate($this->Template, $arrData); } } }