Application->GetVar('currency_list'); if (!$currency_id_list) { return ; } $object =& $event->getObject( Array('skip_autoload' => true) ); $pt_id = $this->Application->GetVar('pt_id'); if ($pt_id === false) { return ; } $sql = 'DELETE FROM ' . $object->TableName . ' WHERE PaymentTypeId = ' . $pt_id; $this->Conn->Query($sql); foreach ($currency_id_list as $id) { $object->SetDBField('CurrencyId', $id); $object->SetDBField('PaymentTypeId', $pt_id); $this->customProcessing($event, 'before'); if ( $object->Create() ) { $this->customProcessing($event, 'after'); $event->status = erSUCCESS; } else { $event->status = erFAIL; $event->redirect = false; $this->Application->SetVar($event->Prefix_Special . '_SaveEvent', 'OnCreate'); $object->setID(0); } } } }