Class SchemaManager

Description

Responsible for the synchronization of Schema classes with the database, and the creation of new Types.

  • author: Gabe Schine
  • version: $Id: SchemaManager.class.php,v 1.32 2007/09/04 20:25:32 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/dataManager/schema/SchemaManager.class.php (line 17)


	
			
Variable Summary
mixed $_schemas
Method Summary
SchemaManager SchemaManager (array $preloadTypes)
ref createSchema (string $type, string $displayName, [optional $revision = 1], [optional $description = ''])
void deleteSchema (string $id)
string generatePHPCode (ref $schema, string $varName)
array getAllSchemaIDs ()
ref getSchemaByID (integer $id)
void loadMultiple (ref $preloadTypes)
void loadTypes (array $preloadTypes)
integer numberOfTypes ()
boolean schemaExists (string $type)
boolean synchronize (ref $new)
ref _addSchema (string $type, string $displayName, int $revision, string $description)
Variables
mixed $_schemas (line 19)
Methods
Constructor SchemaManager (line 26)

Constructor.

SchemaManager SchemaManager (array $preloadTypes)
  • array $preloadTypes: An array containing a number of Schema type IDs to pre-load structure data for. This will avoid queries later on.
createSchema (line 150)

Returns a new Schema object of $type.

  • return: object The new Schema object.
  • access: public
ref createSchema (string $type, string $displayName, [optional $revision = 1], [optional $description = ''])
  • string $type: A DNS-style unique ID. Example: "edu.middlebury.schemas.person"
  • string $displayName: This Schema's display name.
  • optional $revision: int $revision The revision of this schema, useful for updating data structures. (default=1)
  • optional $description: string $description A longer description of this Schema.
deleteSchema (line 245)

Delete a schema (mark it inactive

  • since: 6/6/06
  • access: public
void deleteSchema (string $id)
  • string $id
generatePHPCode (line 467)

Will return a string containing valid PHP code to generate the schema passed.

  • static:
  • access: public
string generatePHPCode (ref $schema, string $varName)
  • string $varName: The name of the variable in the PHP code that will end up containing the Schema object.
  • ref $schema: object $schema The Schema from which to generate code.
getAllSchemaIDs (line 233)

Returns an array of all registered Schema IDs.

  • access: public
array getAllSchemaIDs ()
getSchemaByID (line 216)

Returns the Schema object corresponding to $id.

  • return: object The schema.
  • access: public
ref getSchemaByID (integer $id)
  • integer $id: The ID of the definition.
loadMultiple (line 86)

Will load the data structures for multiple Schemas.

  • access: public
void loadMultiple (ref $preloadTypes)
  • ref $preloadTypes: object An array containing the list of types IDs to be loaded.
loadTypes (line 43)

Fetches from the DB a list of registered DataSetTypes.

void loadTypes (array $preloadTypes)
  • array $preloadTypes: An array containing a number of Schema type IDs to load structure data for. This will avoid queries later on.
numberOfTypes (line 137)

Returns the number of registered schemas.

integer numberOfTypes ()
schemaExists (line 206)

Returns TRUE/FALSE if we have a Schema for type $type.

  • access: public
boolean schemaExists (string $type)
  • string $type: A unique type/ID string.
synchronize (line 270)

Passed a Schema, will make sure that the definition stored in the database reflects what is stored in the passed object.

  • return: Success/failure.
  • access: public
boolean synchronize (ref $new)
  • ref $new: object A Schema object.
_addSchema (line 165)

Adds a Schema to the list of registered types, and makes sure that it is reference in the database as well.

  • return: object The new Schema object.
  • access: private
ref _addSchema (string $type, string $displayName, int $revision, string $description)
  • string $type: A DNS-style unique ID. Example: "edu.middlebury.schemas.person"
  • string $displayName: This Schema's display name.
  • int $revision: The revision of this schema, useful for updating data structures. (default=1)
  • string $description: A longer description of this Schema.

Documentation generated on Wed, 19 Sep 2007 10:26:19 -0400 by phpDocumentor 1.3.0RC3