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::Schema(3) User Contributed Perl Documentation Oryx::Schema(3)

Oryx::Schema - Schema class for Oryx

  package CMS::Schema;
 
  # enable auto deploy for all classes 
  use Oryx::Class(auto_deploy => 1);
   
  # useful if you want to say $storage->deploySchema('CMS::Schema');
  use CMS::Page;
  use CMS::Paragraph;
  use CMS::Image;
  use CMS::Author;
   
  sub prefix { 'cms' }

  1;

  #==================================================================
  # ALTERNATIVE - With XML::DOM::Lite installed
  #==================================================================
  package CMS::Schema;
  use base qw(Oryx::Schema);
  1;
  __DATA__
  <Schema>
    <Class name="CMS::Page">
      <Attribute name="title" type="String"/>
      <Attribute name="num" type="Integer"/>
      <Association role="author" class="CMS::Author"/>
    </Class>
    <Class name="CMS::Author">
      <Attribute name="first_name" type="String"/>
      <Attribute name="last_name" type="String"/>
    </Class>
  </Schema>
  use CMS::Schema;
   
  my $cms_storage = Oryx->connect(\@conn, 'CMS::Schema'); 
  CMS::Schema->addClass('CMS::Revision');
  my @cms_classes = CMS::Schema->classes;
  $cms_storage->deploySchema();                 # deploys only classes seen by CMS::Schema
  $cms_storage->deploySchema('CMS::Schema')     # same thing, but `use's CMS::Schema first
  my $name = CMS::Schema->name;                 # returns CMS_Schema
  CMS::Schema->hasClass($classname);            # true if seen $classname

Schema class for Oryx.

The use of this class is optional.

The intention is to allow arbitrary grouping of classes into different namespaces to support simultaneous use of different storage backends, or for having logically separate groups of classes in the same database, but having table names prefixed to provide namespace separation.

Oryx, Oryx::Class

Copyright (C) 2005 Richard Hundt <richard NO SPAM AT protea-systems.com>

This library is free software and may be used under the same terms as Perl itself.
2006-05-31 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.