iId; } function getLabel() { return $this->sLabel; } function setLabel($sLabel) { $this->sLabel = $sLabel; } function getType() { return $this->sType; } function setType($sType) { $this->sType = $sType; } function getIntData1() { return $this->iData1; } function setIntData1($iData1) { $this->iData1 = $iData1; } function getIntData2() { return $this->iData2; } function setIntData2($iData2) { $this->iData2 = $iData2; } function getStrData1() { return $this->sData1; } function setStrData1($sData1) { $this->sData1 = $sData1; } function getStrData2() { return $this->sData2; } function setStrData2($sData2) { $this->sData2 = $sData2; } var $_aFieldToSelect = array( "iId" => "id", "iUserId" => "user_id", "sLabel" => "label", "sType" => "type", "dCreationDate" => "creation_date", "iData1" => "data_int_1", "iData2" => "data_int_2", "sData1" => "data_str_1", "sData2" => "data_str_2", ); function _table () { return KTUtil::getTableName('notifications'); } function render() { $notificationRegistry =& KTNotificationRegistry::getSingleton(); $handler = $notificationRegistry->getHandler($this->sType); return $handler->handleNotification($this); } // Static function function &get($iId) { return KTEntityUtil::get('KTNotification', $iId); } function &getList($sWhereClause = null) { return KTEntityUtil::getList2('KTNotification', $sWhereClause); } function &createFromArray($aOptions) { return KTEntityUtil::createFromArray('KTNotification', $aOptions); } } /** register the base handlers. */ $notificationRegistry =& KTNotificationRegistry::getSingleton(); // abstract base-class for notification handler. class KTNotificationHandler { function handleNotification($oKTNotification) { $oTemplating = new KTTemplating; $oTemplate = $oTemplating->loadTemplate("kt3/notifications/generic"); $aTemplateData = array( "context" => $oKTNotification, ); return $oTemplate->render($aTemplateData); } } class KTSubscriptionNotification extends KTNotificationHandler { function handleNotification($oKTNotification) { $oTemplating = new KTTemplating; $oTemplate = $oTemplating->loadTemplate("kt3/notifications/subscriptions"); $aTemplateData = array( "context" => $oKTNotification, ); return $oTemplate->render($aTemplateData); } } $notificationRegistry->registerNotificationHandler("ktcore/subscriptions","KTSubscriptionNotification"); ?>