Development

Changeset 8679

You must first sign up to be able to contribute.

Changeset 8679

Show
Ignore:
Timestamp:
04/29/08 18:01:14 (5 years ago)
Author:
trivoallan
Message:

sfPropelNotificationPlugin : Notification logic methods are now passed the watch instance as second parameter.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfPropelNotificationPlugin/trunk/README

    r8655 r8679  
    273273=== trunk === 
    274274 
     275==== 2008-04-29 ==== 
     276 * Notification logic methods are now passed the watch instance as second parameter 
     277 
    275278==== 2008-04-28 ==== 
    276279 * added setBeforeSave() and getBeforeSave() methods to public API 
  • plugins/sfPropelNotificationPlugin/trunk/config/sfPropelNotificationPlugin/types.yml

    r3571 r8679  
    11example_type: 
    2   enabled: on 
     2  enabled: off 
    33  logic_class: ExampleLogicProvider 
  • plugins/sfPropelNotificationPlugin/trunk/lib/util/sfPropelNotificationDispatcher.class.php

    r3560 r8679  
    3535    foreach ($watches as $watch) 
    3636    { 
    37       if (self::isWorthNotifying($object, $watch_type)) 
     37      if (self::isWorthNotifying($object, $watch)) 
    3838      {       
    3939        foreach ($watch->getNotifiers() as $notifier) 
     
    7474   *  
    7575   * @param       BaseObject     $object 
    76    * @param       string         $watch_type 
     76   * @param       BaseObject     $watch 
    7777   * @return      bool 
    7878   */ 
    79   private static function isWorthNotifying(BaseObject $object, $watch_type
     79  private static function isWorthNotifying(BaseObject $object, BaseObject $watch
    8080  { 
    8181    include(sfConfigCache::getInstance()->checkConfig('config/sfPropelNotificationPlugin/types.yml')); 
    8282    $types = sfConfig::get('sfPropelNotificationPlugin_types'); 
    8383 
    84     if (!isset($types[$watch_type])) 
     84    if (!isset($types[$watch->getWatchType()])) 
    8585    { 
    86       $msg = sprintf('Unknown notification type "%s"', $watch_type); 
     86      $msg = sprintf('Unknown notification type "%s"', $watch->getWatchType()); 
    8787      throw new Exception($msg); 
    8888    } 
    8989     
    9090    return call_user_func(array($types[$watch_type]['logic_class'],  
    91                                 sfInflector::camelize($watch_type)), $object); 
     91                                sfInflector::camelize($watch->getWatchType())), $object, $watch); 
    9292  } 
    9393