GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Oryx::Parent(3) User Contributed Perl Documentation Oryx::Parent(3)

Oryx::Parent - multiple inheritance meta-type for Oryx

 package Fruit;
 use base qw(Oryx::Class);
 our $schema = {
     attributes => [{
         colour => 'String',
     }],
 }
 1;
 
 package Food;
 use base qw(Oryx::Class);
 our $schema = {
     attributes => [{
         energy => 'Float',
     }],
 }
 1;
 
 package Orange;
 use base qw(Fruit Food);
 our $schema = {
     attributes => [{
         segments => 'Integer',
     }]
 }
 1;
 
 use Orange;
 my $orange = Orange->create({
     segments => 10,
     energy   => 543.21,
     colour   => 'orange',
 });
 
 $orange->update;
 $orange->commit;
 
 my $id = $orange->id;
 undef $orange;
 
 my $retrieved = Orange->retrieve($id);
 print $retrieved->colour;        # prints 'orange'
 
 my $food_instance = $retrieved->PARENT('Food');
 print $food_instance->energy;    # prints 543.21
 
 $food_instance->energy(42.00);
 $food_instance->update;
 
 my $changed_orange = Orange->retrieve($id);
 print $changed_orange->energy;   # prints 42.00 (parent instance updated)

Oryx::Parent objects are constructed during Oryx::Class initialization by inspecting your class' @ISA array, so you get one of these hanging off your class for each superclass that is also an Oryx::Class derivative.
2006-02-17 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.