Mango::Product - A product
my $product = $provider->get_by_sku('ABC-123'); print $product->created; my $attributes = $product->attributes; while (my $attribute = $attributes->next) { print $attribute->name, ': ', $attribute->value; };
Mango::Product represents a product returned from the products provider.
Adds attribute to the product. atttributes may be hashes containing name/value data, or Mango::Attribute objects;
atttributes
$product->add_attributes( {name => 'Color', value => 'red'}, $attributeobject );
Same as add_attributes.
add_attributes
Adds tags to the product. tags may be tag strings, or Mango::Tag objects;
tags
$product->add_tags( 'computers', $tagobject );
Same as add_tag.
add_tag
Returns a list of attributes for the product in list context, or a Mango::Iterator in scalar context.
my @attributes = $product->attributes({ name => 'A%' }); my $iterator = $product->attributes({ name => 'A%' });
Deletes the current item from the provider.
Deletes attributes for the product matching the supplied filter..
$product->delete_attributes({ name => 'Color' });
Sames as delete_attributes.
delete_attributes
Returns id of the current product.
print $product->id;
Returns the date the product was created as a DateTime object.
print $product->created;
Returns the date the product was last updated as a DateTime object.
print $product->updated;
Gets/sets the sku/part number of the product.
print $product->sku;
Gets/sets the name of the product.
print $product->description;
Gets/sets the price of the product.
print $product->price;
Returns a list of tags for the product in list context, or a Mango::Iterator in scalar context.
my @tags = $product->tags({ name => 'A%' }); my $iterator = $product->tags({ name => 'A%' });
Deletes tags from the product matching the supplied filter..
$product->delete_tags({ 'computer' });
Sames as delete_tags.
delete_tags
Saves any changes to the profile back to the provider.
Mango::Object, Mango::Provider::Profiles
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.