]>
iEval git - gruntmaster-data.git/blob - lib/Gruntmaster/Data/Result/Problem.pm
5b843919c7250507743fc5d542be7012a138aeb6
2 package Gruntmaster
::Data
::Result
::Problem
;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Gruntmaster::Data::Result::Problem
16 use base
'DBIx::Class::Core';
18 =head1 TABLE: C<problems>
22 __PACKAGE__
->table("problems");
130 __PACKAGE__
->add_columns(
132 { data_type
=> "text", is_nullable
=> 0 },
134 { data_type
=> "text", is_nullable
=> 1 },
136 { data_type
=> "text", is_nullable
=> 1 },
138 { data_type
=> "text", is_nullable
=> 0 },
140 { data_type
=> "text", is_nullable
=> 0 },
142 { data_type
=> "text", is_nullable
=> 0 },
144 { data_type
=> "text", is_nullable
=> 0 },
146 { data_type
=> "integer", is_nullable
=> 1 },
148 { data_type
=> "text", is_foreign_key
=> 1, is_nullable
=> 0 },
150 { data_type
=> "boolean", default_value
=> \"false
", is_nullable => 0 },
152 { data_type => "text
", is_nullable => 0 },
154 { data_type => "text
", is_nullable => 0 },
156 { data_type => "integer
", is_nullable => 0 },
158 { data_type => "text
", is_nullable => 1 },
160 { data_type => "real
", is_nullable => 0 },
162 { data_type => "integer
", is_nullable => 1 },
164 { data_type => "text
", is_nullable => 1 },
166 { data_type => "text
", is_nullable => 1 },
168 { data_type => "text
", is_nullable => 1 },
170 { data_type => "text
", is_nullable => 1 },
183 __PACKAGE__->set_primary_key("id
");
187 =head2 contest_problems
191 Related object: L<Gruntmaster::Data::Result::ContestProblem>
195 __PACKAGE__->has_many(
197 "Gruntmaster
::Data
::Result
::ContestProblem
",
198 { "foreign
.problem
" => "self
.id
" },
199 { cascade_copy => 0, cascade_delete => 0 },
206 Related object: L<Gruntmaster::Data::Result::Job>
210 __PACKAGE__->has_many(
212 "Gruntmaster
::Data
::Result
::Job
",
213 { "foreign
.problem
" => "self
.id
" },
214 { cascade_copy => 0, cascade_delete => 0 },
221 Related object: L<Gruntmaster::Data::Result::Open>
225 __PACKAGE__->has_many(
227 "Gruntmaster
::Data
::Result
::Open
",
228 { "foreign
.problem
" => "self
.id
" },
229 { cascade_copy => 0, cascade_delete => 0 },
236 Related object: L<Gruntmaster::Data::Result::User>
240 __PACKAGE__->belongs_to(
242 "Gruntmaster
::Data
::Result
::User
",
244 { is_deferrable => 0, on_delete => "CASCADE
", on_update => "NO ACTION
" },
251 Composing rels: L</contest_problems> -> contest
255 __PACKAGE__->many_to_many("contests
", "contest_problems
", "contest
");
258 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-05-16 15:03:32
259 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tvap77v0faSMxFiLu1uggQ
262 my ($self, $time) = @_;
263 return 1 if $self->private;
264 grep { $_->contest->is_pending($time) } $self->contest_problems;
268 my ($self, $time) = @_;
269 0 == grep { $_->contest->is_running($time) } $self->contest_problems;
273 $_->rerun for shift->jobs
282 =head2 is_private(I<[$time]>)
284 Returns true if the problem is private at time I<$time> (which defaults to C<time>).
286 =head2 is_in_archive(I<[$time]>)
288 Returns true if the problem is in the archive at time I<$time> (which defaults to C<time>).
292 Reruns all jobs for this problem.
296 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
298 =head1 COPYRIGHT AND LICENSE
300 Copyright (C) 2014 by Marius Gavrilescu
302 This library is free software; you can redistribute it and/or modify
303 it under the same terms as Perl itself, either Perl version 5.18.1 or,
304 at your option, any later version of Perl 5 you may have available.
This page took 0.061145 seconds and 3 git commands to generate.