|
NAMET2::Schema - Tangram Schemas, suitable for putting in a Tangram StoreSYNOPSISuse T2::Schema;my $schema = T2::Schema->load("site"); $schema->compile(); new Object(); DESCRIPTIONMETHODS
$schema->read_file("site" | $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. $schema->compileLoads 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 $schema->generatorReturns a Class::Tangram::Generator object that is valid for this Schema.$schema->schema_rawReturns 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. $schema->schema$schema->schema_cookedGenerates 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.$schema->storageReturns the Tangram Storage class associated with this Schema. Possibly connecting to the database.$schema->class($name)Returns the class definition for class $name.Croaks if there is no class $name. $schema->class_exists($name)Returns the class definition for class $name.Returns undef if no such class is found. $schema->class_or_new($name)Returns the class definition for class $name.Returns a new class if no such class is found.
$schema->sorted_classesReturns 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.$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 ERRORSHey! The above document had some coding errors, which are explained below:
Visit the GSP FreeBSD Man Page Interface. |