| 1 | package Eve::Item::Entry; | ||
| 2 | |||
| 3 | 2 | ▶ | use parent qw(Eve::Item); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 2 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | =head1 NAME | ||
| 9 | |||
| 10 | B<Eve::Item::Entry> - a base class for workflow items. | ||
| 11 | |||
| 12 | =head1 SYNOPSIS | ||
| 13 | |||
| 14 | package Eve::Item::Entry::Foo; | ||
| 15 | |||
| 16 | use parent qw(Eve::Item::Entry); | ||
| 17 | |||
| 18 | sub init { | ||
| 19 | my ($self, %arg_hash) = @_; | ||
| 20 | my $rest_hash = Eve::Support::arguments( | ||
| 21 | \%arg_hash, my $some_attribute); | ||
| 22 | $self->SUPER::init(%{$rest_hash}); | ||
| 23 | |||
| 24 | $self->{'some_attribute'} = $some_attribute; | ||
| 25 | } | ||
| 26 | |||
| 27 | 1; | ||
| 28 | |||
| 29 | my $foo = Eve::Item::Entry::Foo->new( | ||
| 30 | some_attribute => 'some value', | ||
| 31 | some_super_attribute => 'super value'); | ||
| 32 | |||
| 33 | print $foo->some_attribute, $foo->some_super_attribute | ||
| 34 | |||
| 35 | =head1 DESCRIPTION | ||
| 36 | |||
| 37 | B<Eve::Item::Entry> is a base class for timed and stateful data | ||
| 38 | items. It is primarily assumed to be used as a base for database row | ||
| 39 | representations. | ||
| 40 | |||
| 41 | =head3 Constants | ||
| 42 | |||
| 43 | =over 4 | ||
| 44 | |||
| 45 | =item STATUS_ACTIVE | ||
| 46 | |||
| 47 | =back | ||
| 48 | |||
| 49 | =cut | ||
| 50 | |||
| 51 | 2 | ▶ | use constant { |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 52 | 2 | STATUS_ACTIVE => 1 | |
| 53 | 2 | }; | |
| 54 | |||
| 55 | =head3 Attributes | ||
| 56 | |||
| 57 | =over 4 | ||
| 58 | |||
| 59 | =item C<id> | ||
| 60 | |||
| 61 | =item C<created> | ||
| 62 | |||
| 63 | =item C<modified> | ||
| 64 | |||
| 65 | =item C<status> | ||
| 66 | |||
| 67 | =back | ||
| 68 | |||
| 69 | =head3 Constructor arguments | ||
| 70 | |||
| 71 | The same as the attributes described above. | ||
| 72 | |||
| 73 | =head1 METHODS | ||
| 74 | |||
| 75 | =head2 B<init()> | ||
| 76 | |||
| 77 | =cut | ||
| 78 | |||
| 79 | 3 | ▶ | sub init { |
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
documented
| |||
| 80 | 3 | my ($self, %arg_hash) = @_; | |
| 81 | 3 | my $arg_hash = Eve::Support::arguments( | |
| 82 | \%arg_hash, my ($id, $created, $modified, $status)); | ||
| 83 | |||
| 84 | 3 | $self->{'id'} = $id; | |
| 85 | 3 | $self->{'created'} = $created; | |
| 86 | 3 | $self->{'modified'} = $modified; | |
| 87 | 3 | $self->{'status'} = $status; | |
| 88 | |||
| 89 | 3 | return; | |
| 90 | } | ||
| 91 | |||
| 92 | =head1 SEE ALSO | ||
| 93 | |||
| 94 | =over 4 | ||
| 95 | |||
| 96 | =item L<Eve::Item> | ||
| 97 | |||
| 98 | =back | ||
| 99 | |||
| 100 | =head1 LICENSE AND COPYRIGHT | ||
| 101 | |||
| 102 | Copyright 2012 Igor Zinovyev. | ||
| 103 | |||
| 104 | This program is free software; you can redistribute it and/or modify it | ||
| 105 | under the terms of either: the GNU General Public License as published | ||
| 106 | by the Free Software Foundation; or the Artistic License. | ||
| 107 | |||
| 108 | See http://dev.perl.org/licenses/ for more information. | ||
| 109 | |||
| 110 | |||
| 111 | =head1 AUTHOR | ||
| 112 | |||
| 113 | =over 4 | ||
| 114 | |||
| 115 | =item L<Sergey Konoplev|mailto:gray.ru@gmail.com> | ||
| 116 | |||
| 117 | =back | ||
| 118 | |||
| 119 | =cut | ||
| 120 | |||
| 121 | 2 | 1; | |