The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mango::Object - Base class used for Mango result objects.

SYNOPSIS

    package Mango::User;
    use base qw/Mango::Object/;

DESCRIPTION

Mango::Object is the base class for all result objects in Mango. It provides common methods exposed by all results like id, created, updated, update, etc.

CONSTRUCTOR

new

Arguments: \%args

Creates a new object, blessing args into the current package.

METHODS

id

Returns id of the current object.

    print $object->id;

created

Returns the date the object was created as a DateTime object.

    print $object->created;

destroy

Deletes the current item from the provider.

updated

Returns the date the object was last updated as a DateTime object.

    print $object->updated;

update

Saves any changes to the object back to the provider.

provider

Gets/sets the provider which created the result.

data

The raw column data for the current object.

get_column

Arguments: $column

Returns the value of the specified column from data.

    print $object->get_column('foo');
    # same as $object->foo;

set_column

Arguments: $column, $value

Sets the value of the specified column in data.

    $object->set_column('foo', 'bar');
    # same as $object->foo('bar');

SEE ALSO

Handel::Currency, Data::Currency

AUTHOR

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