Class SchemaField

Description

Holds information about a specific field within a Schema. Defines what type of data the field holds (string, integer, etc) and if it can have multiple values.

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


	
			
Variable Summary
mixed $_active
mixed $_addToDB
mixed $_associated
mixed $_delete
mixed $_id
mixed $_label
mixed $_mult
mixed $_required
mixed $_schema
mixed $_type
mixed $_update
Method Summary
SchemaField SchemaField (string $label, string $name, string $type, [optional $description = ""], [optional $mult = false], [optional $required = false], [optional $active = true])
void addToDB ()
void associate (ref $schema)
int commit ([optional $id = null])
void delete ()
string getDescription ()
string getDisplayName ()
string getID ()
string getLabel ()
bool getMultFlag ()
string getType ()
bool isActive ()
bool isRequired ()
ref replicate ()
void setActiveFlag (bool $bool)
void setMultFlag (bool $mult)
void setRequired (bool $req)
void update ()
void updateDescription (string $description)
void updateDisplayName (string $name)
Variables
mixed $_active (line 26)
mixed $_addToDB (line 28)
mixed $_associated (line 25)
mixed $_delete (line 29)
mixed $_description (line 24)
mixed $_displayName (line 19)
mixed $_id (line 17)
mixed $_label (line 22)
mixed $_mult (line 21)
mixed $_required (line 23)
mixed $_schema (line 18)
mixed $_type (line 20)
mixed $_update (line 30)
Methods
Constructor SchemaField (line 42)

Constructor

SchemaField SchemaField (string $label, string $name, string $type, [optional $description = ""], [optional $mult = false], [optional $required = false], [optional $active = true])
  • string $label: the unique label for this field.
  • string $name: the field's display name
  • string $type: The string name as registered with the DataTypeManager of the data type (ie, "string", "integer", "boolean", etc)
  • optional $description: string $description a description for this field
  • optional $mult: boolean $mult flag specifying if multiple values are allowed
  • optional $required: boolean $required flag specifying if we will disallow a database commit without at least one value for this field
  • optional $active: boolean $active flag specifying if this field is to be used or no.
addToDB (line 289)

Flags that we should add ourselves to the databse as a new row upon commit().

  • access: public
void addToDB ()
associate (line 86)

After being added to a Schema, it calls associate() to tie us to its type. This way, we can only be added to one Schema.

  • access: public
void associate (ref $schema)
  • ref $schema: object $schema The schema to which we are being added.
commit (line 186)

Reflects any changes made locally to the database.

  • return: Returns our ID in the database or NULL upon error.
  • access: public
int commit ([optional $id = null])
  • optional $id: int $id The ID in the database to update (if not adding...).
delete (line 279)

Flags that we should deactivate ourselves upon commit()

  • access: public
void delete ()
getDescription (line 150)

Returns this field's description.

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

Returns our display name.

  • access: public
string getDisplayName ()
getID (line 106)

Returns this field's ID (assuming it has been associated with a Schema)

  • access: public
string getID ()
getLabel (line 160)

Returns our text-label.

  • access: public
string getLabel ()
getMultFlag (line 115)

Returns if this field is allowed to have multiple values.

  • access: public
bool getMultFlag ()
getType (line 178)

Returns the DataType registered with the DataTypeManager that we are tied to.

  • access: public
string getType ()
isActive (line 319)

Returns if this field is active within the Schema or not.

  • access: public
bool isActive ()
isRequired (line 121)

Returns if this field is required to hold at least one value.

bool isRequired ()
replicate (line 309)

Returns a replica of this object.

  • return: object A new SchemaField object.
  • access: public
ref replicate ()
setActiveFlag (line 327)

Sets if this field should be active within the Schema.

  • access: public
void setActiveFlag (bool $bool)
  • bool $bool
setMultFlag (line 140)

Sets if this field is allowed to have multiple values.

  • access: public
void setMultFlag (bool $mult)
  • bool $mult
setRequired (line 130)

Sets if this field should be required or not.

void setRequired (bool $req)
  • bool $req
update (line 299)

Flags that we should update an existing row in the database upon commit().

  • access: public
void update ()
updateDescription (line 335)

Sets this field's description.

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

Sets this field's display name.

  • access: public
void updateDisplayName (string $name)
  • string $name

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