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.
Returns a new Schema object of $type.
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.
Delete a schema (mark it inactive
void
deleteSchema
(string $id)
Will return a string containing valid PHP code to generate the schema passed.
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.
Returns an array of all registered Schema IDs.
array
getAllSchemaIDs
()
Returns the Schema object corresponding to $id.
ref
getSchemaByID
(integer $id)
-
integer
$id: The ID of the definition.
Will load the data structures for multiple Schemas.
void
loadMultiple
(ref $preloadTypes)
-
ref
$preloadTypes: object An array containing the list of types IDs to be loaded.
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.
Returns the number of registered schemas.
integer
numberOfTypes
()
Returns TRUE/FALSE if we have a Schema for type $type.
boolean
schemaExists
(string $type)
-
string
$type: A unique type/ID string.
Passed a Schema, will make sure that the definition stored in the database reflects what is stored in the passed object.
boolean
synchronize
(ref $new)
-
ref
$new: object A Schema object.
Adds a Schema to the list of registered types, and makes sure that it is reference in the database as well.
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.