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 },
96 =head2 contest_statuses
100 Related object: L<Gruntmaster::Data::Result::ContestStatus>
104 __PACKAGE__
->has_many(
106 "Gruntmaster::Data::Result::ContestStatus",
107 { "foreign.contest" => "self.id" },
108 { cascade_copy
=> 0, cascade_delete
=> 0 },
115 Related object: L<Gruntmaster::Data::Result::Job>
119 __PACKAGE__
->has_many(
121 "Gruntmaster::Data::Result::Job",
122 { "foreign.contest" => "self.id" },
123 { cascade_copy
=> 0, cascade_delete
=> 0 },
130 Related object: L<Gruntmaster::Data::Result::Open>
134 __PACKAGE__
->has_many(
136 "Gruntmaster::Data::Result::Open",
137 { "foreign.contest" => "self.id" },
138 { cascade_copy
=> 0, cascade_delete
=> 0 },
145 Related object: L<Gruntmaster::Data::Result::User>
149 __PACKAGE__
->belongs_to(
151 "Gruntmaster::Data::Result::User",
153 { is_deferrable
=> 0, on_delete
=> "CASCADE", on_update
=> "NO ACTION" },
160 Composing rels: L</contest_problems> -> problem
164 __PACKAGE__
->many_to_many("problems", "contest_problems", "problem");
167 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-12-11 23:51:27
168 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nu+Io9AhYkzYCky5UpCaKQ
171 my ($self, $time) = @_;
172 $self->start > ($time // time)
176 my ($self, $time) = @_;
177 $self->stop <= ($time // time)
181 my ($self, $time) = @_;
182 !$self->is_pending($time) && !$self->is_finished($time)
191 =head2 is_pending(I<[$time]>)
193 Returns true if the contest is pending at time I<$time> (which defaults to C<time>).
195 =head2 is_finished(I<[$time]>)
197 Returns true if the contest is finished at time I<$time> (which defaults to C<time>).
199 =head2 is_running(I<[$time]>)
201 Returns true if the contest is running at time I<$time> (which defaults to C<time>).
205 Marius Gavrilescu E<lt>marius@ieval.roE<gt>
207 =head1 COPYRIGHT AND LICENSE
209 Copyright (C) 2014 by Marius Gavrilescu
211 This library is free software; you can redistribute it and/or modify
212 it under the same terms as Perl itself, either Perl version 5.18.1 or,
213 at your option, any later version of Perl 5 you may have available.
This page took 0.027156 seconds and 4 git commands to generate.