NAME
Tree::Persist::Base - The base class for the Tree persistence plugin hierarchy
DESCRIPTION
This provides a useful baseclass for all the Tree::Persist plugins.
PARAMETERS
These are the parameters provided for by this class. These are in addition to whatever parameters the child class may use.
autocommit (optional)
This will be the initial setting for the autocommit value. (Please see
autocommit()
for more info.)class (optional)
This is the class that will be used to bless the nodes into, unless the datastore specifies otherwise. It will default to 'Tree'.
METHODS
new({ %opts })
This is the constructor.
%opts
is the set of parameters described in Tree::Persist.autocommit( [$autocommit] )
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.
SUPPORSUPPORT
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.
COPYRIGHT AND LICENSE
Copyright 2004, 2005 by Infinity Interactive, Inc.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.