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


Manual Reference Pages  -  ORYX::PARENT (3)

.ds Aq ’

NAME

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

CONTENTS

SYNOPSIS



 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)



DESCRIPTION

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.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 ORYX::PARENT (3) 2006-02-17

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