Ben Sommer > Myco-1.22 > Myco

Download:
Myco-1.22.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 1.22   Source  

NAME ^

Myco - The myco object framework

VERSION ^

Release

1.21

SYNOPSIS ^

 use Myco;

 ### DB connection
 Myco->db_connect(@dbconn);
 Myco->db_disconnect(@dbconn);

 $storage = Myco->storage;      # Tangram connection object

 ### Object retrieval
 $obj = Myco->load($id);        # retrieval by Tangram object id

 # Retrieve all of given class
 @objects = Myco->select('Myco::Foo');

 # Retrieve all of given class, using 'remote' object and filtering
 $remote = Myco->remote('Myco::Foo');
 @objects = Myco->select($remote, $filter);

 # Retrieve all of given class, by cursor
 $cursor = Myco->select('Myco::Foo');
 while (my $obj = $cursor->current()) {
     # process $obj
     $cursor->next();
 }

 ### Object insertion and update
                                # Myco::Entity alternative
 Myco->insert($obj);               # $obj->save;
 Myco->update($obj);               # $obj->save;
 Myco->update(@objects);

 ### Object removal - from db and memory
 Myco->destroy($obj);              # $obj->destroy;
 Myco->destroy(@objects);

 ### Object removal - from just db
 Myco->erase(@objects);

See Tangram::Storage for other miscellany.

DESCRIPTION ^

Encapsulates functionality of Tangram::Storage but treats the storage connection object as class data, allowing access to object persistence functionality via class method calls.

Intended for use with so-called myco "entity" objects, that is those belonging to classes that inherit from Myco::Entity. Use of inherited instance methods for managing object persistence state where possible is preferred. (ie. use $obj->save instead of both Myco->insert($obj) and Myco->update($obj).)

Pulls in all other required classes of entire Myco class system.

BUGS ^

Use of AUTOLOAD for Tangram::Storage encapsulation should be retired for performance reasons.

LICENSE AND COPYRIGHT ^

Copyright (c) 2006 the myco project. All rights reserved. This software is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO ^

all Tangram -related perldoc, Myco::Entity,

syntax highlighting: