1 # This file has been auto-generated only because it didn't exist.
2 # Feel free to modify it at will; it will not be overwritten automatically.
4 package SL::DB::CsvImportReport;
8 use SL::DB::MetaSetup::CsvImportReport;
10 __PACKAGE__->meta->add_relationships(
12 type => 'one to many',
13 class => 'SL::DB::CsvImportReportRow',
14 column_map => { id => 'csv_import_report_id' },
17 type => 'one to many',
18 class => 'SL::DB::CsvImportReportStatus',
19 column_map => { id => 'csv_import_report_id' },
23 __PACKAGE__->meta->make_manager_class;
24 __PACKAGE__->meta->initialize;
29 $self->_fold_rows unless $self->{folded_rows};
31 return $self->{folded_rows};
37 $self->_fold_status unless $self->{folded_status};
39 return $self->{folded_status};
45 $self->{folded_rows} = [];
47 for my $row_obj (@{ $self->rows }) {
48 $self->{folded_rows}->[ $row_obj->row ] ||= [];
49 $self->{folded_rows}->[ $row_obj->row ][ $row_obj->col ] = $row_obj->value;
56 $self->{folded_status} = [];
58 for my $status_obj (@{ $self->status }) {
59 $self->{folded_status}->[ $status_obj->row ] ||= {};
60 $self->{folded_status}->[ $status_obj->row ]{information} ||= [];
61 $self->{folded_status}->[ $status_obj->row ]{errors} ||= [];
62 push @{ $self->{folded_status}->[ $status_obj->row ]{ $status_obj->type } }, $status_obj->value;