Index: branches/5.2.x/units/payment_type/payment_type_event_handler.php =================================================================== diff -u -N -r14587 -r14625 --- branches/5.2.x/units/payment_type/payment_type_event_handler.php (.../payment_type_event_handler.php) (revision 14587) +++ branches/5.2.x/units/payment_type/payment_type_event_handler.php (.../payment_type_event_handler.php) (revision 14625) @@ -1,6 +1,6 @@ getObject(); + $object =& $event->getObject(); + /* @var $object kDBItem */ - $status_field = array_shift( $this->Application->getUnitOption($event->Prefix,'StatusField') ); + $status_field = array_shift( $this->Application->getUnitOption($event->Prefix, 'StatusField') ); - if($object->GetDBField('IsPrimary')==1 && $object->GetDBField($status_field)==0){ + if ( $object->GetDBField('IsPrimary') == 1 && $object->GetDBField($status_field) == 0 ) { $object->SetDBField($status_field, 1); } $this->convertGroups($event); } /** - * Occurse before creating item + * Occurs before creating item * * @param kEvent $event - * @access public + * @return void + * @access protected */ - function OnBeforeItemCreate(&$event) + protected function OnBeforeItemCreate(&$event) { parent::OnBeforeItemCreate($event); @@ -134,11 +137,13 @@ * Disable delete on primary payment type * * @param kEvent $event + * @param string $type + * @return void * @access protected */ - - function customProcessing(&$event, $when){ - if ($event->Name == 'OnMassDelete' && $when == 'before'){ + protected function customProcessing(&$event, $type) + { + if ($event->Name == 'OnMassDelete' && $type == 'before'){ $object = &$event->getObject(); $ids = $event->getEventParam('ids'); @@ -157,9 +162,18 @@ } } - function OnSave(&$event) + /** + * Saves content of temp table into live and + * redirects to event' default redirect (normally grid template) + * + * @param kEvent $event + * @return void + * @access protected + */ + protected function OnSave(&$event) { $this->Application->StoreVar('check_unused_currencies', 1); + parent::OnSave($event); } @@ -219,11 +233,14 @@ } /** - * Apply system filter to themes list + * Apply any custom changes to list's sql query * * @param kEvent $event + * @return void + * @access protected + * @see kDBEventHandler::OnListBuild() */ - function SetCustomQuery(&$event) + protected function SetCustomQuery(&$event) { parent::SetCustomQuery($event);