Class::PObjectClass::PObject is a simple framework for programming persistent objects. | |
Download |
Class::PObject Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Sherzod B. Ruzmetov
- Publisher web site:
- http://search.cpan.org/~sherzodr/Class-PObject-2.17/PObject.pm
Class::PObject Tags
Class::PObject Description
Class::PObject is a simple framework for programming persistent objects. Class::PObject is a simple framework for programming persistent objects.SYNOPSISAfter loading Class::PObject with use, we can declare a class: pobject Person => { columns => , datasource => './data' };We can also declare the class in its own .pm file: package Person; use Class::PObject; pobject { columns => , datasource => './data' };We can now create an instance of above Person, fill it with data, and save it: $person = new Person(); $person->name('Sherzod'); $person->email('sherzodrcpan.org'); $new_id = $person->save()We can access the saved Person later, make necessary changes and save back: $person = Person->load($new_id); $person->name('Sherzod Ruzmetov (The Geek)'); $person->save()We can load multiple objects as well: @people = Person->load(); for $person ( @people ) { printf(" %s < %s >n", $person->id, $person->name, $person->email) }or we can load all the objects based on some criteria and sort the list by column name in descending order, and limit the results to only the first 3 objects: @people = Person->load( {name => "Sherzod"}, {sort => "name", direction => "desc", limit=>3});We can also seek into a specific point of the result set: @people = Person->load(undef, {offset=>10, limit=>10}); Requirements: · Perl
Class::PObject Related Software