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

NAME

Class::AlzaboWrapper::Cursor - Higher level wrapper around Alzabo cursor objects

SYNOPSIS

  my $cursor = Class::AlzaboWrapper::Cursor->new( cursor => $cursor );

DESCRIPTION

This module works with Class::AlzaboWrapper to make sure that objects returned from cursors are of the appropriate Class::AlzaboWrapper subclass, not raw Alzabo::Runtime::Cursor objects.

THIS MODULE IS STILL AN ALPHA RELEASE. THE INTERFACE MAY CHANGE IN FUTURE RELEASES.

USAGE

This module provides the following methods:

  • new

    This method expects a cursor parameter, which should be an Alzabo::Runtime::Cursor object. This is the cursor being wrapped by this class.

    It also takes an "args" parameter. This is an optional array reference. If given, then the arguments specified will be passed when calling new() for the appropriate subclass(es).

    The "constructor_method" argument allows you to specify what method to call when fetching the next object via next(). This defaults to "new".

  • next

    This method is called to get the next object (or objects) in the cursor. Internally, it calls new() on the appropriate Class::AlzaboWrapper subclass for each Alzabo::Runtime::Row object returned by the wrapped cursor. It can be called in scalar or array context, but in scalar context it will only return the first object when there are more than one, so be careful.

  • next_as_hash

    Wrapper for the cursor's next_as_hash() method, it behaves the same as next in that each row is returned as an appropriate Class::AlzaboWrapper subclass object. Returns a hash keyed to the table name(s).

  • all

    Returns an array containing all the remaining objects in the cursor. If the wrapped cursor just returned single rows, then it returns an array of objects. Otherwise, it returns an array of array references, with each reference containing one set of objects.

  • count

    A simple wrapper around the underlying cursor's count() method.

SUPPORT

The Alzabo docs are conveniently located online at http://www.alzabo.org/docs/.

There is also a mailing list. You can sign up at http://lists.sourceforge.net/lists/listinfo/alzabo-general.

Please don't email me directly. Use the list instead so others can see your questions.

COPYRIGHT

Copyright (c) 2002-2005 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

AUTHOR

Dave Rolsky, <autarch@urth.org>