Skip to content

Commit

Permalink
Add id method to Nitesi::Cart class.
Browse files Browse the repository at this point in the history
  • Loading branch information
racke authored and rmtemplet committed Oct 5, 2011
1 parent 27bae61 commit 6b5b566
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/Nitesi/Cart.pm
Expand Up @@ -227,6 +227,23 @@ sub clear {
$self->{items} = [];
}

=head2 id
Get or set id of the cart. This can be used for subclasses,
e.g. primary key value for carts in the database.
=cut

sub id {
my $self = shift;

if (@_ > 0) {
$self->{id} = $_[0];
}

return $self->{id};
}

=head2 name
Get or set the name of the cart.
Expand Down

0 comments on commit 6b5b566

Please sign in to comment.