]>
iEval git - gruntmaster-data.git/blob - lib/Gruntmaster/Data/Result/Contest.pm
2 package Gruntmaster
::Data
::Result
::Contest
;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Gruntmaster::Data::Result::Contest
16 use base
'DBIx::Class::Core';
18 =head1 TABLE: C<contests>
22 __PACKAGE__
->table("contests");
54 __PACKAGE__
->add_columns(
56 { data_type
=> "text", is_nullable
=> 0 },
58 { data_type
=> "text", is_nullable
=> 0 },
60 { data_type
=> "integer", is_nullable
=> 0 },
62 { data_type
=> "integer", is_nullable
=> 0 },
64 { data_type
=> "text", is_foreign_key
=> 1, is_nullable
=> 0 },
77 __PACKAGE__
->set_primary_key("id");
81 =head2 contest_problems
85 Related object: L<Gruntmaster::Data::Result::ContestProblem>
89 __PACKAGE__
->has_many(
91 "Gruntmaster::Data::Result::ContestProblem",
92 { "foreign.contest" => "self.id" },
93 { cascade_copy
=> 0, cascade_delete
=> 0 },
100 Related object: L<Gruntmaster::Data::Result::Job>
104 __PACKAGE__
->has_many(
106 "Gruntmaster::Data::Result::Job",
107 { "foreign.contest" => "self.id" },
108 { cascade_copy
=> 0, cascade_delete
=> 0 },
115 Related object: L<Gruntmaster::Data::Result::Open>
119 __PACKAGE__
->has_many(
121 "Gruntmaster::Data::Result::Open",
122 { "foreign.contest" => "self.id" },
123 { cascade_copy
=> 0, cascade_delete
=> 0 },
130 Related object: L<Gruntmaster::Data::Result::User>
134 __PACKAGE__
->belongs_to(
136 "Gruntmaster::Data::Result::User",
138 { is_deferrable
=> 0, on_delete
=> "CASCADE", on_update
=> "NO ACTION" },
145 Composing rels: L</contest_problems> -> problem
149 __PACKAGE__
->many_to_many("problems", "contest_problems", "problem");
152 # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-05-16 15:03:32
153 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8PPzBpDmSTq4ukKuxIlLlQ
156 my ($self, $time) = @_;
157 $self->start > ($time // time)
161 my ($self, $time) = @_;
162 $self->stop <= ($time // time)
166 my ($self, $time) = @_;
167 !$self->is_pending($time) && !$self->is_finished($time)
176 =head2 is_pending(I<[$time]>)
178 Returns true if the contest is pending at time I<$time> (which defaults to C<time>).
180 =head2 is_finished(I<[$time]>)
182 Returns true if the contest is finished at time I<$time> (which defaults to C<time>).
184 =head2 is_running(I<[$time]>)
186 Returns true if the contest is running at time I<$time> (which defaults to C<time>).
190 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
192 =head1 COPYRIGHT AND LICENSE
194 Copyright (C) 2014 by Marius Gavrilescu
196 This library is free software; you can redistribute it and/or modify
197 it under the same terms as Perl itself, either Perl version 5.18.1 or,
198 at your option, any later version of Perl 5 you may have available.
This page took 0.058239 seconds and 4 git commands to generate.