/[transports]/trunk/lib/Transports/Model/Transport.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/lib/Transports/Model/Transport.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (hide annotations)
Thu May 4 15:12:03 2006 UTC (18 years, 1 month ago) by dpavlin
File size: 1514 byte(s)
initital import

1 dpavlin 1 use strict;
2     use warnings;
3    
4     package Transports::Model::Transport::Schema;
5     use Jifty::DBI::Schema;
6    
7     # Your column definitions go here. See L<Jifty::DBI::Schema> for
8     # documentation about how to write column definitions.
9    
10     column date =>
11     type is 'timestamp',
12     label is 'Date',
13     is immutable,
14     render_as 'unrendered',
15     default is 'now()',
16     since '0.0.1';
17    
18     column source =>
19     refers_to Transports::Model::Source,
20     label is 'Source client',
21     # render_as 'Combobox',
22     # sort_order is 'name',
23     # render_as 'select',
24     is mandatory,
25     since '0.0.6';
26    
27     column destination =>
28     refers_to Transports::Model::Destination,
29     label is 'Destionation client',
30     is mandatory,
31     since '0.0.7';
32    
33     column request_nr =>
34     type is 'text',
35     label is 'Change request nr',
36     is mandatory,
37     since '0.0.7';
38    
39     column client_dependent =>
40     type is 'boolean',
41     label 'Client dependent',
42     is mandatory,
43     since '0.0.7',
44    
45     column created_by =>
46     refers_to Transports::Model::User,
47     since '0.0.7';
48    
49    
50     package Transports::Model::Transport;
51     use base qw/Transports::Record/;
52     use Transports::Model::Source;
53     use Transports::Model::Destination;
54     use Transports::Model::User;
55    
56     # Your model-specific methods go here.
57    
58     =head2 create
59    
60     Create new transport and fill in C<created_by>.
61    
62     =cut
63    
64     sub create {
65     my $self = shift;
66     my %args = (@_);
67     # my $now = DateTime->now();
68     # $args{'updated'} = $now->ymd . " " . $now->hms;
69     $args{'created_by'} = ( $self->current_user ? $self->current_user->user_object : undef );
70     my ($id) = $self->SUPER::create(%args);
71     return ($id);
72     }
73    
74    
75     1;
76    

  ViewVC Help
Powered by ViewVC 1.1.26