The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mango::Attribute - Module representing a product attribute

SYNOPSIS

    my $attributes = $product->attributes;
    
    while (my $attribute = $attributes->next) {
        print $attribute->name, ': ', $attribute->value;
    };

DESCRIPTION

Mango::Attribute represents an attribute (name/value pair) of an individual product.

METHODS

created

Returns the date and time in UTC the attribute was created as a DateTime object.

    print $attribute->created;

destroy

Deletes the current attribute from the product to which it is assigned.

    $attribute->destroy;

id

Returns the id of the current attribute.

    print $attribute->id;

name

Arguments: $name

Gets/sets the name of the current attribute.

    print $attribute->name;

update

Saves any changes made to the attribute back to the provider.

    $attribute->value('Red');
    $attribute->update;

Whenever "update" is called, "updated" is automatically set to the current time in UTC.

updated

Returns the date and time in UTC the attribute was last updated as a DateTime object.

    print $attribute->updated;

value

Arguments: $value

Gets/sets the value of the current attribute.

    print $attribute->value;

SEE ALSO

Mango::Object, Mango::Product, Mango::Provider::Products, DateTime

AUTHOR

    Christopher H. Laco
    CPAN ID: CLACO
    claco@chrislaco.com
    http://today.icantfocus.com/blog/