Bb::Collaborate::Ultra::DAO is an abstract base class for various resource classes (e.g. Bb::Collaborate::Ultra::Session) and contains both builder and inherited methods from implementing these classes.

ABSTRACT METHODS

The following methods are inherited from this class.

new

Creates a new object.

post

Creates object on the server. E.g.

    my $start = time() + 60;
    my $end = $start + 900;
    my $session = Bb::Collaborate::Ultra::Session->post($connection, {
            name => 'Test Session',
            startTime => $start,
            endTime   => $end,
            },
        );

patch

Updates an existing object

    $session->name('Test Session - Updated');
    $session->endTime($session->endTime + 60);
    $session->patch; # enact updates

get

Fetches one or more objects from the server.

    my @future_sessions = Bb::Collaborate::Ultra::Session->get($connection, {endTime => time(), limit => 50}, )

delete

Deletes an object from the server

    $session->delete;

find_or_create

Attempts a get on the object. If that fails, creates an new object on the server.

path

Computes a RESTful resource path for the object.

parent

Returns any parent class for the object. May be used to compute the path.

changed

Returns a list of fields that have been updated since the object was last saved via a `patch`, or `post`, or fetched via a `get`.

connection

Returns the connection associated with the object. Will be set if the object has been fetched via a `get`, added via a `post` or updated via a `patch`.

Internal METHODS

query_params

    __PACKAGE__->query_params(
        name => 'Str',
        extId => 'Str',
    );

This is used to specify any additional payload fields that may be passed as query parameters, or returned along with object data.

freeze

Serializes an object to JSON., with data conversion.

Dates are converted from numeric Unix timestamps to date-strings
Booleans are converted from numeric (0, 1) to 'true', or 'false'.
Nested objects are recursively serialized.

thaw

The reverse of `freeze`. Deserializes JSON data to objects, with conversion of dates, boolean values or nested objects.

construct

Constructs a new object from server data.

load_schema

Constructs the object class from JSON schema data

LICENSE AND COPYRIGHT

Copyright 2016 David Warring.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.