Mango::Provider::Orders - Provider class for order information
my $provider = Mango::Provider::Orders->new; my $order = $provider->get_by_id(23);
Mango::Provider::Orders is the provider class responsible for creating, deleting, updating and searching order information.
Creates a new order provider object. If options are passed to new, those are sent to setup.
setup
my $provider = Mango::Provider::Orders->new;
See "new" in Mango::Provider for a list of other possible options.
Creates a new Mango::Order object using the supplied data.
my $order = $provider->create({ user => 23 }); print $order->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 order is assigned to.
my $order = $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 orders from the provider matching the supplied filter.
$provider->delete({ id => 23 });
$provider->delete({ user => $user });
Returns a Mango::Order object matching the specified id.
my $order = $provider->get_by_id(23);
Returns undef if no matching order can be found.
Returns a list of Mango::Order objects in list context, or a Mango::Iterator in scalar context matching the specified filter.
my @orders = $provider->search({ last_name => 'Alberts' }); my $iterator = $provider->search({ last_name => 'Alberts' });
This can be a user id, or a user object for which orders are assigned to.
my @carts = $provider->search({ user => $user }); my $carts = $provider->search({ user => $user });
See "search" in Handel::Order for a list of other possible options.
Sets the 'updated' column to DateTime->now and saves any changes made to the order back to the underlying store.
my $order = $provider->create(\%data); $order->number(154325); $provider->update($order);
Mango::Provider, Mango::Order, Handel::Order
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.