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  -  T2::SCHEMA (3)

.ds Aq ’

NAME

T2::Schema - Tangram Schemas, suitable for putting in a Tangram Store

CONTENTS

SYNOPSIS

use T2::Schema;

my $schema = T2::Schema->load(site); $schema->compile();

new Object();

DESCRIPTION

METHODS

<B>T2::Schema->load(‘‘site’’[, B>$source<B>])B> This is actually a constructor :-).

Load the schema for site and return it.

$source, if given, may be a Tangram::Storage object - in which case it is assumed to be the schema database. If missing, T2::Storage->connect() is used to obtain a handle to the schema database.

$source may also be the correct Schema object, for convenience. In this case it is returned unchanged.

CB$schema->read_file(‘‘site’’ | CB$filename)

This is actually a constructor :-).

Load a dumped schema for site and returns it. $filename, if given, may be the name of a file to use, or the site name (in which case, the file name is assumed to be etc/site.t2.

CW$schema->compile

Loads all of the classes in the schema in to memory.

Tries to use on-disk versions rather than generating the in-memory object & then compiling it.

The idea is that Class::Tangram version 2 uses ‘Class’ objects as input bread and butter rather than ‘schema’ structures. This should eliminate the necessity for a huge ‘eval’.

This interface is deprecated in favour of using $schema->generator

CW$schema->generator

Returns a Class::Tangram::Generator object that is valid for this Schema.

CW$schema->schema_raw

Returns the data structure that is fed into Tangram::Schema->new().

Note that Tangram performs various in-place edits of this data structure. So don’t go assuming too much about it.

CW$schema->schema

CW$schema->schema_cooked

Generates a Tangram Schema for this Schema, or returns the one that was already generated. Use $schema->set_schema(undef) to force a re-generation of the Tangram Schema structure.

CW$schema->storage

Returns the Tangram Storage class associated with this Schema. Possibly connecting to the database.

CW$schema->class($name)

Returns the class definition for class $name.

Croaks if there is no class $name.

CW$schema->class_exists($name)

Returns the class definition for class $name.

Returns undef if no such class is found.

CW$schema->class_or_new($name)

Returns the class definition for class $name.

Returns a new class if no such class is found.
add_class_from_schema($name => $schema) Adds a Class object to this schema, gleaning information from $schema, which you perhaps found in $YourClass::schema.

CW$schema->sorted_classes

Returns the classes in inheritance first order. Actually this function is pretty redundant, you can just call sort $schema->classes, but this implementation takes a different approach.

CW$schema->traverse(sub { })

Traverses over every object in the schema, setting $_[0] to the item.

T2::Schema->self_schema()

Returns a structure of T2::Schema and related objects that represents the schema of the T2::Schema modules.

POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 160: You forgot a ’=back’ before ’=head2’
Around line 490: ’=item’ outside of any ’=over’
Around line 546: You forgot a ’=back’ before ’=head2’
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 T2::SCHEMA (3) 2005-11-06

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