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

use T2::Schema;
my $schema = T2::Schema->load("site"); $schema->compile();
new Object();


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.
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.
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
Returns a Class::Tangram::Generator object that is valid for this Schema.
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.
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.
Returns the Tangram Storage class associated with this Schema. Possibly connecting to the database.
Returns the class definition for class $name.
Croaks if there is no class $name.
Returns the class definition for class $name.
Returns undef if no such class is found.
Returns the class definition for class $name.
Returns a new class if no such class is found.
Adds a Class object to this schema,
gleaning information from $schema,
which you perhaps found in $YourClass::schema.
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.
Traverses over every object in the schema, setting $_[0] to the item.
Returns a structure of T2::Schema and related objects that represents the schema of the T2::Schema modules.