public static function getNotificationMessagesAsOptions($objDc = null, $strType = null) { $arrOptions = array(); if (!$strType) { $objMessages = Message::findAll(); if ($objMessages === null) { return $arrOptions; } while ($objMessages->next()) { if (($objNotification = $objMessages->getRelated('pid')) === null) { continue; } $arrOptions[$objNotification->title][$objMessages->id] = $objMessages->title; } } else { $objMessages = \Database::getInstance()->execute("SELECT m.id,m.title FROM tl_nc_message m INNER JOIN tl_nc_notification n ON m.pid=n.id WHERE n.type='{$strType}' ORDER BY m.title"); if ($objMessages->numRows > 0) { while ($objMessages->next()) { $arrOptions[$objMessages->id] = $objMessages->title; } } } return $arrOptions; }
public function getNotificationMessagesAsOptions() { $arrOptions = array(); if (($objMessages = Message::findAll()) === null) { return $arrOptions; } while ($objMessages->next()) { if (($objNotification = $objMessages->getRelated('pid')) === null) { continue; } $arrOptions[$objNotification->title][$objMessages->id] = $objMessages->title; } return $arrOptions; }