{ eZDebugSetting::writeDebug('kernel-notification', $params, 'params for type collaboration'); $event->setAttribute('data_int1', $params['collaboration_id']); $event->setAttribute('data_text1', $params['collaboration_identifier']); } function attributes() { return array_merge(array('collaboration_identifier', 'collaboration_id'), eZNotificationEventType::attributes()); } function hasAttribute($attributeName) { return in_array($attributeName, $this->attributes()); } function attribute($attributeName) { if ($attributeName == 'collaboration_identifier') { return eZNotificationEventType::attribute('data_text1'); } else { if ($attributeName == 'collaboration_id') { return eZNotificationEventType::attribute('data_int1'); } } return eZNotificationEventType::attribute($attributeName); } function eventContent($event) { return eZCollaborationItem::fetch($event->attribute('data_int1')); } } eZNotificationEventType::register(eZCollaborationEventType::NOTIFICATION_TYPE_STRING, 'eZCollaborationEventType');
class eZCurrentTimeType extends eZNotificationEventType { const NOTIFICATION_TYPE_STRING = 'ezcurrenttime'; /*! Constructor */ function eZCurrentTimeType() { $this->eZNotificationEventType(self::NOTIFICATION_TYPE_STRING); } function initializeEvent($event, $params) { eZDebugSetting::writeDebug('kernel-notification', $params, 'params for type'); $time = 0; if (array_key_exists('time', $params)) { $time = $params['time']; } else { $time = time(); } $event->setAttribute('data_int1', $time); } function eventContent($event) { $date = new eZDate(); $stamp = $event->attribute('data_int1'); $date->setTimeStamp($stamp); return $date; } } eZNotificationEventType::register(eZCurrentTimeType::NOTIFICATION_TYPE_STRING, 'eZCurrentTimeType');
* @version //autogentag// * @package kernel */ /*! \class eZPublishType ezpublishtype.php \brief The class eZPublishType does */ class eZPublishType extends eZNotificationEventType { const NOTIFICATION_TYPE_STRING = 'ezpublish'; /*! Constructor */ function eZPublishType() { $this->eZNotificationEventType(self::NOTIFICATION_TYPE_STRING); } function initializeEvent($event, $params) { eZDebugSetting::writeDebug('kernel-notification', $params, 'params for type'); $event->setAttribute('data_int1', $params['object']); $event->setAttribute('data_int2', $params['version']); } function eventContent($event) { return eZContentObjectVersion::fetchVersion($event->attribute('data_int2'), $event->attribute('data_int1')); } } eZNotificationEventType::register(eZPublishType::NOTIFICATION_TYPE_STRING, 'eZPublishType');
<?php class jajNewsletterEventType extends eZNotificationEventType { const NOTIFICATION_TYPE_STRING = 'jaj_newsletter'; /*! Constructor */ function eZPublishType() { $this->eZNotificationEventType(self::NOTIFICATION_TYPE_STRING); } function initializeEvent($event, $params) { $event->setAttribute('data_int1', $params['list_id']); $event->setAttribute('data_text1', $params['action']); $event->setAttribute('data_text2', $params['uuid']); } function eventContent($event) { return eZContentObjectVersion::fetchVersion($event->attribute('data_int2'), $event->attribute('data_int1')); } } eZNotificationEventType::register(jajNewsletterEventType::NOTIFICATION_TYPE_STRING, 'jajNewsletterEventType');