Perl5-CoreSmokeDB-Schema

 view release on metacpan or  search on metacpan

lib/Perl5/CoreSmokeDB/Schema/Result/Config.pm  view on Meta::CPAN

  },
  "started",
  { data_type => "timestamp with time zone", is_nullable => 1 },
  "duration",
  { data_type => "integer", is_nullable => 1 },
  "cc",
  {
    data_type   => "text",
    is_nullable => 1,
    original    => { data_type => "varchar" },
  },
  "ccversion",
  {
    data_type   => "text",
    is_nullable => 1,
    original    => { data_type => "varchar" },
  },
);

=head1 PRIMARY KEY

=over 4

=item * L</id>

=back

=cut

__PACKAGE__->set_primary_key("id");

=head1 RELATIONS

=head2 report

Type: belongs_to

Related object: L<Perl5::CoreSmokeDB::Schema::Result::Report>

=cut

__PACKAGE__->belongs_to(
  "report",
  "Perl5::CoreSmokeDB::Schema::Result::Report",
  { id => "report_id" },
  { is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);

=head2 results

Type: has_many

Related object: L<Perl5::CoreSmokeDB::Schema::Result::Result>

=cut

__PACKAGE__->has_many(
  "results",
  "Perl5::CoreSmokeDB::Schema::Result::Result",
  { "foreign.config_id" => "self.id" },
  { cascade_copy => 0, cascade_delete => 0 },
);


# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-09-06 09:15:22
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:l/lxpTgyv35unrcVapM8JQ

sub c_compiler_key {
    my $self = shift;
    return join("##", $self->cc, $self->ccversion);
}

sub c_compiler_label {
    my $self = shift;
    return join(" - ", $self->cc, $self->ccversion);
}

sub c_compiler_pair {
    my $self = shift;
    return {value => $self->c_compiler_key, label => $self->c_compiler_label};
}

sub full_arguments {
    my $self = shift;
    return $self->debugging eq 'D'
        ? join(" ", $self->arguments, 'DEBUGGING')
        : $self->arguments;
}

=head2 $record->as_hashref([$is_full])

Returns a HashRef with the inflated columns.

=head3 Parameters

Positional:

=over

=item 1. C<'full'>

If the word C<full> is passed as the first argument the related
C<results> are also included in the resulting HashRef.

=back

=cut

sub as_hashref {
    my $self = shift;
    my ($is_full) = @_;
    $is_full //= '';

    my $record = { $self->get_inflated_columns };
    $record->{started} = $self->started->rfc3339;

    if ($is_full eq 'full') {
        $record->{results} = [ map { $_->as_hashref($is_full) } $self->results ];
    }

    return $record;



( run in 1.174 second using v1.01-cache-2.11-cpan-9581c071862 )