Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
Add id method to Nitesi::Cart class.
Browse files Browse the repository at this point in the history
  • Loading branch information
racke committed Sep 29, 2011
1 parent 5f39727 commit e77bb55
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 e77bb55

Please sign in to comment.