]>
iEval git - gruntmaster-data.git/blob - Problem.pm
098701eb10d4c2e3e981aa705b37f8630a2e2733
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");
135 __PACKAGE__
->add_columns(
137 { data_type
=> "text", is_nullable
=> 0 },
139 { data_type
=> "text", is_nullable
=> 1 },
141 { data_type
=> "text", is_nullable
=> 1 },
143 { data_type
=> "text", is_nullable
=> 0 },
145 { data_type
=> "text", is_nullable
=> 0 },
147 { data_type
=> "text", is_nullable
=> 0 },
149 { data_type
=> "text", is_nullable
=> 0 },
151 { data_type
=> "integer", is_nullable
=> 1 },
153 { data_type
=> "text", is_foreign_key
=> 1, is_nullable
=> 0 },
155 { data_type
=> "boolean", default_value
=> \"false
", is_nullable => 0 },
157 { data_type => "text
", is_nullable => 0 },
159 { data_type => "text
", is_nullable => 1 },
161 { data_type => "text
", is_nullable => 0 },
163 { data_type => "integer
", is_nullable => 0 },
165 { data_type => "text
", is_nullable => 1 },
167 { data_type => "real
", is_nullable => 0 },
169 { data_type => "integer
", is_nullable => 0 },
171 { data_type => "text
", is_nullable => 1 },
173 { data_type => "text
", is_nullable => 1 },
175 { data_type => "text
", is_nullable => 1 },
177 { data_type => "text
", is_nullable => 1 },
190 __PACKAGE__->set_primary_key("id
");
194 =head2 contest_problems
198 Related object: L<Gruntmaster::Data::Result::ContestProblem>
202 __PACKAGE__->has_many(
204 "Gruntmaster
::Data
::Result
::ContestProblem
",
205 { "foreign
.problem
" => "self
.id
" },
206 { cascade_copy => 0, cascade_delete => 0 },
213 Related object: L<Gruntmaster::Data::Result::Job>
217 __PACKAGE__->has_many(
219 "Gruntmaster
::Data
::Result
::Job
",
220 { "foreign
.problem
" => "self
.id
" },
221 { cascade_copy => 0, cascade_delete => 0 },
228 Related object: L<Gruntmaster::Data::Result::Open>
232 __PACKAGE__->has_many(
234 "Gruntmaster
::Data
::Result
::Open
",
235 { "foreign
.problem
" => "self
.id
" },
236 { cascade_copy => 0, cascade_delete => 0 },
243 Related object: L<Gruntmaster::Data::Result::User>
247 __PACKAGE__->belongs_to(
249 "Gruntmaster
::Data
::Result
::User
",
251 { is_deferrable => 0, on_delete => "CASCADE
", on_update => "NO ACTION
" },
258 Composing rels: L</contest_problems> -> contest
262 __PACKAGE__->many_to_many("contests
", "contest_problems
", "contest
");
265 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-07 00:51:56
266 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KjAtOerTqBqtcMrBtwJ3Bw
269 my ($self, $time) = @_;
270 return 1 if $self->private;
271 grep { $_->contest->is_pending($time) } $self->contest_problems;
275 my ($self, $time) = @_;
276 0 == grep { $_->contest->is_running($time) } $self->contest_problems;
280 $_->rerun for shift->jobs
289 =head2 is_private(I<[$time]>)
291 Returns true if the problem is private at time I<$time> (which defaults to C<time>).
293 =head2 is_in_archive(I<[$time]>)
295 Returns true if the problem is in the archive at time I<$time> (which defaults to C<time>).
299 Reruns all jobs for this problem.
303 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
305 =head1 COPYRIGHT AND LICENSE
307 Copyright (C) 2014 by Marius Gavrilescu
309 This library is free software; you can redistribute it and/or modify
310 it under the same terms as Perl itself, either Perl version 5.18.1 or,
311 at your option, any later version of Perl 5 you may have available.
This page took 0.067929 seconds and 3 git commands to generate.