Ron Savage > Tree-Persist-1.10 > Tree::Persist::Base

Download:
Tree-Persist-1.10.tgz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 1.10   Source  

NAME ^

Tree::Persist::Base - The base class for the Tree persistence plugin hierarchy

SYNOPSIS ^

See "SYNOPSIS" in Tree::Persist or scripts/xml.demo.pl for sample code.

DESCRIPTION ^

This provides a useful baseclass for all the Tree::Persist plugins.

Existing plugins are:

PARAMETERS ^

Parameters are used in the call to "connect({%opts})" in Tree::Persist or "create_datastore({%opts})" in Tree::Persist.

These are the parameters provided for by this class. These are in addition to whatever parameters sub-classes may use.

METHODS ^

new({%opts})

This is the constructor. %opts is the set of parameters as described above. Sub-classes may add their own optional or mandatory parameters.

End-user code never calls new(). You always call "connect({%opts})" in Tree::Persist or "create_datastore({%opts})" in Tree::Persist

autocommit([$autocommit])

Here, [] indicate an optional parameter.

If called without any parameters, this will return the current autocommit setting. If called with a parameter, it will set the autocommit flag to the truth value of the parameter, then return the old setting.

Autocommit, if turned on, will write any changes made to the tree directly to the datastore. If it's off, you will have to explicitly issue a commit.

NOTE: If you turn autocommit off, then back on, it will not issue a commit until the next change occurs. At that time, it will commit all changes that have occurred since the last commit.

commit()

If any changes are queued up, this will write them to the database. If there are no changes, this is a no-op.

rollback()

If there are any changes queued up, this will discard those changes and reload the tree from the datastore. If there are no changes, this is a no-op.

tree()

This will return the tree that is being persisted.

CODE COVERAGE ^

Please see the relevant section of Tree::Persist.

SUPPORT ^

Please see the relevant section of Tree::Persist.

AUTHORS ^

Rob Kinyon <rob.kinyon@iinteractive.com>

Stevan Little <stevan.little@iinteractive.com>

Thanks to Infinity Interactive for generously donating our time.

Co-maintenance since V 1.01 is by Ron Savage <rsavage@cpan.org>. Uses of 'I' in previous versions is not me, but will be hereafter.

COPYRIGHT AND LICENSE ^

Copyright 2004, 2005 by Infinity Interactive, Inc.

http://www.iinteractive.com

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: