]>
iEval git - gruntmaster-data.git/blob - lib/Gruntmaster/Data/Result/Problem.pm
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
" },
254 =head2 problem_statuses
258 Related object: L<Gruntmaster::Data::Result::ProblemStatus>
262 __PACKAGE__->has_many(
264 "Gruntmaster
::Data
::Result
::ProblemStatus
",
265 { "foreign
.problem
" => "self
.id
" },
266 { cascade_copy => 0, cascade_delete => 0 },
273 Composing rels: L</contest_problems> -> contest
277 __PACKAGE__->many_to_many("contests
", "contest_problems
", "contest
");
280 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-11 23:51:27
281 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1SnNCeJdFr5lM3mmO6rtqA
284 my ($self, $time) = @_;
285 return 1 if $self->private;
286 grep { $_->contest->is_pending($time) } $self->contest_problems;
290 my ($self, $time) = @_;
291 0 == grep { $_->contest->is_running($time) } $self->contest_problems;
295 $_->rerun for shift->jobs
304 =head2 is_private(I<[$time]>)
306 Returns true if the problem is private at time I<$time> (which defaults to C<time>).
308 =head2 is_in_archive(I<[$time]>)
310 Returns true if the problem is in the archive at time I<$time> (which defaults to C<time>).
314 Reruns all jobs for this problem.
318 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
320 =head1 COPYRIGHT AND LICENSE
322 Copyright (C) 2014 by Marius Gavrilescu
324 This library is free software; you can redistribute it and/or modify
325 it under the same terms as Perl itself, either Perl version 5.18.1 or,
326 at your option, any later version of Perl 5 you may have available.
This page took 0.057553 seconds and 4 git commands to generate.