Index: branches/5.2.x/units/destinations/dst_event_handler.php =================================================================== diff -u -N -r15047 -r15061 --- branches/5.2.x/units/destinations/dst_event_handler.php (.../dst_event_handler.php) (revision 15047) +++ branches/5.2.x/units/destinations/dst_event_handler.php (.../dst_event_handler.php) (revision 15061) @@ -1,6 +1,6 @@ getObject( Array('skip_autoload' => true) ); + $object =& $event->getObject(Array ('skip_autoload' => true)); /* @var $object kDBItem */ // creates multiple db records from single request (OnCreate event only creates 1 record) @@ -57,20 +59,25 @@ * @return void * @access protected */ - protected function customProcessing(&$event, $type) + protected function customProcessing(kEvent &$event, $type) { - if($type != 'before') return ; + if ( $type != 'before' ) { + return; + } $object =& $event->getObject(); + /* @var $object kDBItem */ + $events = $this->Application->GetVar('events'); - if($events['z'] == 'OnUpdate') - { + + if ( $events['z'] == 'OnUpdate' ) { $object->SetDBField('ShippingZoneId', $this->Application->GetVar('z_id')); } $zone_object =& $this->Application->recallObject('z'); - if($zone_object->GetDBField('Type') == 3) - { + /* @var $zone_object kDBItem */ + + if ( $zone_object->GetDBField('Type') == 3 ) { $object->SetDBField('StdDestId', $this->Application->GetVar('ZIPCountry')); } }