Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0929128e

Von Jan Büren vor etwa 3 Jahren hinzugefügt

  • ID 0929128e47bfa00d012594b35065dc47069f3609
  • Vorgänger 0b68d45d
  • Nachfolger fd7bc620

CsvImport: Interface für zusätzliche Angaben beim Import immer speichern

Unterschiede anzeigen:

SL/Controller/CsvImport/Base.pm
539 539
    SL::DB->client->with_transaction(sub {
540 540
      foreach my $entry_index ($chunk_size * $chunk .. min( $last_index, $chunk_size * ($chunk + 1) - 1 )) {
541 541
        my $entry = $data->[$entry_index];
542
        next if @{ $entry->{errors} };
543 542

  
544 543
        my $object = $entry->{object_to_save} || $entry->{object};
544
        $self->save_additions_always($object);
545

  
546
        next if @{ $entry->{errors} };
545 547

  
546 548
        my $ret;
547 549
        if (!eval { $ret = $object->save(cascade => !!$self->save_with_cascade()); 1 }) {
......
602 604
  return;
603 605
}
604 606

  
607
sub save_additions_always {
608
  my ($self, $object) = @_;
609

  
610
  # Can be overridden by derived specialized importer classes to save
611
  # additional tables always.
612
  # This sub is called before the object is saved. Therefore this
613
  # hook will always be executed wether or not the import entry can be saved successfully.
614

  
615
  return;
616
}
617

  
618

  
605 619
sub _save_history {
606 620
  my ($self, $object) = @_;
607 621

  

Auch abrufbar als: Unified diff