Mango::Provider::Carts - Provider class for cart information
my $provider = Mango::Provider::Carts->new; my $cart = $provider->get_by_id(23);
Mango::Provider::Carts is the provider class responsible for creating, deleting, updating and searching cart information.
Creates a new cart provider object. If options are passed to new, those are sent to setup.
setup
my $provider = Mango::Provider::Carts->new;
See "new" in Mango::Provider for a list of other possible options.
Creates a new Mango::Cart object using the supplied data.
my $cart = $provider->create({ user => 23 }); print $cart->count;
In addition to using the column names, the following special keys are available:
This can be a user id, or a user object for which this cart is assigned to.
my $cart = $provider->create({ user => $user });
It is recommended that you use this key, rather than setting the foreign key column manually in case it changes later.
Deletes carts from the provider matching the supplied filter.
$provider->delete({ id => 23 });
$provider->delete({ user => $user });
Returns a Mango::Cart object matching the specified id.
my $cart = $provider->get_by_id(23);
Returns undef if no matching cart can be found.
Returns a list of Mango::Cart objects in list context, or a Mango::Iterator in scalar context matching the specified filter.
my @carts = $provider->search({ name => 'A%' }); my $iterator = $provider->search({ name => 'A%' });
This can be a user id, or a user object for which carts are assigned to.
my @carts = $provider->search({ user => $user }); my $carts = $provider->search({ user => $user });
See "search" in Handel::Cart for a list of other possible options.
Sets the 'updated' column to DateTime->now and saves any changes made to the cart back to the underlying store.
my $cart = $provider->create(\%data); $cart->name('Favorites'); $provider->update($cart);
Mango::Provider, Mango::Cart, Handel::Cart
Christopher H. Laco CPAN ID: CLACO claco@chrislaco.com http://today.icantfocus.com/blog/
To install Mango, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mango
CPAN shell
perl -MCPAN -e shell install Mango
For more information on module installation, please visit the detailed CPAN module installation guide.