Class Schema

Description

Holds the descriptive information about a specific OKI-style DataManager Schema. Schemas define the fields available in a Record, the number of values allowed in that field.

Using the class the actual data structure can be set up in the PHP code and then synchronized to the database using the SchemaManager.

  • author: Gabe Schine
  • version: $Id: Schema.class.php,v 1.21 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/Schema.class.php (line 19)

SObject
   |
   --Schema
Variable Summary
Method Summary
Schema Schema (string $id, string $displayName, [int $revision = 1], [optional $description = ""], [optional $otherParameters = null])
ref addField (ref $field)
void commitAllFields ()
ref deepCopy ()
void deleteField (string $id)
void deleteFieldByLabel (string $label)
int fieldCount ()
boolean fieldExists (string $id)
boolean fieldExistsByLabel (string $label)
array getAllFieldIDs ([optional $includeInactive = false])
array getAllIDs ([optional $includeInactive = false])
array getAllLabels ([optional $includeInactive = false])
string getDescription ()
string getDisplayName ()
ref getField (string $id)
string getFieldDescription (string $id)
void getFieldDisplayName (string $id)
string getFieldIDFromLabel (string $label)
string getFieldLabelFromID (string $id)
string getFieldType (string $id)
ref getID ()
int getRevision ()
bool load ()
bool loaded ([optional $set = null])
void populate (array $arrayOfRows)
void setManagerFlag ()
void setRevision (int $revision)
void updateDescription (string $description)
void updateDisplayName (string $name)
void updateOtherParameters (mixed $otherParameters)
void _addField (ref $field, optional 1)
Variables
mixed $_description (line 24)
mixed $_displayName (line 23)
mixed $_fieldIDs (line 29)
mixed $_fields (line 28)
mixed $_id (line 21)
mixed $_isCreatedByManager (line 33)
mixed $_loaded (line 26)
mixed $_otherParameters (line 35)
mixed $_revision (line 31)
Methods
Constructor Schema (line 44)
Schema Schema (string $id, string $displayName, [int $revision = 1], [optional $description = ""], [optional $otherParameters = null])
  • string $id: A unique type/ID string. Differentiates this Schema from others.
  • string $displayName: This Schema's display name.
  • int $revision: The internal revision number. Useful for keeping track if the Schema definition in the database matches that which you need.
  • optional $description: string $description A description.
  • optional $otherParameters: mixed $otherParameters Other parameters to associated with this Schema. Can be anything.
addField (line 96)

Adds a new field to the Schema.

  • return: object Returns the same SchemaField that was passed.
  • access: public
ref addField (ref $field)
  • ref $field: object $field A SchemaField object to add.
commitAllFields (line 380)

Spiders through all the fields and commits them to the database. Is called from SchemaManager::synchronize().

  • access: public
void commitAllFields ()
deepCopy (line 450)

bla! - deepCopy baby!

  • return: object
  • access: public
ref deepCopy ()

Redefinition of:
SObject::deepCopy()
Answer a copy of the receiver with its own copy of each instance variable.
deleteField (line 290)

Removes the definition for field $id from the Schema.

void deleteField (string $id)
  • string $id
deleteFieldByLabel (line 281)

Removes the definition for $label from the Schema.

void deleteFieldByLabel (string $label)
  • string $label: The string label of the field to delete.
fieldCount (line 272)

Returns the number of fields we have defined.

int fieldCount ()
fieldExists (line 392)

Returns if the field $id is defined.

boolean fieldExists (string $id)
  • string $id
fieldExistsByLabel (line 401)

Returns if the field $label is defined.

boolean fieldExistsByLabel (string $label)
  • string $label: The field's label.
getAllFieldIDs (line 337)

Returns a list of field ids defined.

array getAllFieldIDs ([optional $includeInactive = false])
  • optional $includeInactive: bool $includeInactive If TRUE will also return fields that are inactive (deleted from the definition).
getAllIDs (line 328)

Returns a list of field ids defined.

  • deprecated: Use getAllFieldIDs() instead.
array getAllIDs ([optional $includeInactive = false])
  • optional $includeInactive: bool $includeInactive If TRUE will also return fields that are inactive (deleted from the definition).
getAllLabels (line 350)

Returns a list of labels defined (similar to getAllIDs())

array getAllLabels ([optional $includeInactive = false])
  • optional $includeInactive: bool $includeInactive if TRUE will also return fields that are inactive in this Schema
getDescription (line 123)

Returns the description.

  • access: public
string getDescription ()
getDisplayName (line 114)

Returns the display name.

  • access: public
string getDisplayName ()
getField (line 366)

Returns the SchemaField object for $id.

  • return: object
ref getField (string $id)
  • string $id
getFieldDescription (line 423)

Returns the description of a field.

  • access: public
string getFieldDescription (string $id)
  • string $id: The label of the field.
getFieldDisplayName (line 437)

Returns the display name of a field.

  • access: public
void getFieldDisplayName (string $id)
  • string $id
getFieldIDFromLabel (line 315)

Returns the ID of a field given its label.

  • access: public
string getFieldIDFromLabel (string $label)
  • string $label
getFieldLabelFromID (line 301)

Returns the label of a field given its ID.

  • access: public
string getFieldLabelFromID (string $id)
  • string $id
getFieldType (line 411)

Returns the DataType for field referenced by $id.

string getFieldType (string $id)
  • string $id
getID (line 105)

Returns the type/ID associated with this definition.

  • return: object
ref getID ()
getOtherParameters (line 86)

Returns the other parameters associated with this Schema. It may be NULL or whatever was set at Schema creation time.

  • access: public
mixed getOtherParameters ()
getRevision (line 152)

Returns this schema's revision number.

  • access: public
int getRevision ()
load (line 195)

Loads the definition data from the database, if not already done.

  • return: FALSE on error.
bool load ()
loaded (line 263)

Returns true/false depending on if we've loaded our definition data.

bool loaded ([optional $set = null])
  • optional $set: boolean $set If specified, will set the loaded flag to the passed value. USED INTERNALLY.
populate (line 242)

Populates the object with SchemaField objects based on a number of rows from the database.

void populate (array $arrayOfRows)
  • array $arrayOfRows
setManagerFlag (line 64)

FOR INTERNAL USE - tells this object that it was instantiated by the manager.

  • access: public
void setManagerFlag ()
setRevision (line 163)

Sets the revision number of this schema.

  • access: public
void setRevision (int $revision)
  • int $revision
updateDescription (line 133)

Sets the description.

  • access: public
void updateDescription (string $description)
  • string $description
updateDisplayName (line 143)

Sets the display name.

  • access: public
void updateDisplayName (string $name)
  • string $name
updateOtherParameters (line 76)

Updates the other parameters associated with this Schema. The parameters can be anything that may be useful.

  • access: public
void updateOtherParameters (mixed $otherParameters)
  • mixed $otherParameters
_addField (line 175)

Adds a field to the Schema, consisting of a label and a multiple-values flag.

  • access: private
void _addField (ref $field, optional 1)
  • optional 1: int $id The ID in the Database referring to this field.
  • ref $field: object $field A SchemaField object.

Inherited Methods

Inherited From SObject

SObject::asA()
SObject::asString()
SObject::copy()
SObject::copySameFrom()
SObject::copyTwoLevel()
SObject::deepCopy()
SObject::isEqual()
SObject::isEqualTo()
SObject::isNotEqualTo()
SObject::isNotReferenceTo()
SObject::isReferenceTo()
SObject::newFrom()
SObject::postCopy()
SObject::printableString()
SObject::shallowCopy()
SObject::_deepCopyArray()

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