Ejemplo n.º 1
0
 function eventType()
 {
     if (!isset($this->EventType)) {
         $this->EventType = eZNotificationEventType::create($this->TypeString);
     }
     return $this->EventType;
 }
Ejemplo n.º 2
0
 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);
 }
Ejemplo n.º 3
0
 * @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');
 static function loadAndRegisterAllTypes()
 {
     $allowedTypes = eZNotificationEventType::allowedTypes();
     foreach( $allowedTypes as $type )
     {
         eZNotificationEventType::loadAndRegisterType( $type );
     }
 }
Ejemplo n.º 5
0
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');
 function __construct()
 {
     parent::__construct(self::NOTIFICATION_TYPE_STRING);
 }
Ejemplo n.º 7
0
<?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');