Class RecordField

Description

Holds a number of indexes for values within a specific field within a Record. For those fields with only one value, only index 0 will be used. Otherwise, indexes will be created in numerical order (1, 2, ...).

  • version: $Id: RecordField.class.php,v 1.22 2007/09/04 20:25:31 adamfranco Exp $
  • license: GNU General Public License (GPL)
  • copyright: Copyright © 2005, Middlebury College

Located in /harmoni/core/dataManager/record/RecordField.class.php (line 16)


	
			
Variable Summary
mixed $_id
mixed $_myLabel
mixed $_parent
mixed $_values
Method Summary
RecordField RecordField (mixed $schemaField, mixed $parent)
bool addValueFromPrimitive (ref $value)
void commit ()
bool deleteValue (int $index)
ref getId ()
array getIndices ([optional $includeInactive = false])
ref getRecord ()
ref getRecordFieldValue (int $index)
ref getVersion (int $verID, optional $index)
array getVersionIDs (optional $index)
bool isIndexDeleted (integer $index)
int numValues ([optional $includeInactive = false])
int numVersions (optional $index)
bool populate (ref $arrayOfRows)
void prune (ref $versionConstraint)
void reIndex ()
bool setValueFromPrimitive (int $index, ref $value)
void takeRow (ref $row)
bool undeleteValue (int $index)
bool _checkObjectType (ref $object)
Variables
mixed $_id (line 24)
mixed $_myLabel (line 22)
mixed $_parent (line 20)
mixed $_schemaField (line 21)
mixed $_values (line 18)
Methods
Constructor RecordField (line 26)
RecordField RecordField (mixed $schemaField, mixed $parent)
addValueFromPrimitive (line 183)

Adds $value to a new index within this label, assuming it allows multiple values.

bool addValueFromPrimitive (ref $value)
  • ref $value: object $value A SObject object.
commit (line 111)

Spiders through each index and calls commit() on it.

void commit ()
deleteValue (line 272)

Deactivates all versions under index $index.

bool deleteValue (int $index)
  • int $index
getId (line 398)

Returns the id of this RecordField object.

  • return: object Id The id of this RecordField object.
ref getId ()
getIndices (line 69)

Returns the indices for a multi-valued field. Will only return those values that are active (for version-controlled Records).

  • access: public
array getIndices ([optional $includeInactive = false])
  • optional $includeInactive: boolean $includeInactive Includes inactive indices as well.
getRecord (line 382)

Returns the Record object that the current object is a part of.

  • return: object Record The parent Record object
ref getRecord ()
getRecordFieldValue (line 152)

Returns the RecordFieldValue object associated with $index.

  • return: object
ref getRecordFieldValue (int $index)
  • int $index
getSchemaField (line 390)

Returns the SchemaField object for the this RecordField object.

ref getSchemaField ()
getVersion (line 369)

Returns the RecordFieldData object associated with $verID under $index.

  • return: object
ref getVersion (int $verID, optional $index)
  • int $verID
  • optional $index: int $index Defaults to 0.
getVersionIDs (line 355)

Returns an array of version IDs associated with $index.

array getVersionIDs (optional $index)
  • optional $index: int $index Defaults to 0.
isIndexDeleted (line 310)

Checks if the index has been deleted.

  • access: public
bool isIndexDeleted (integer $index)
  • integer $index
numValues (line 327)

Returns the number of values for this label we have set.

  • access: public
int numValues ([optional $includeInactive = false])
  • optional $includeInactive: boolean $includeInactive if TRUE will include inactive values in the count.
numVersions (line 342)

Returns the number of versions we have set for specific $index.

int numVersions (optional $index)
  • optional $index: int $index Defaults to 0.
populate (line 40)

Takes a number of DB rows and sets up RecordFieldValue objects corresponding to the data within the rows.

bool populate (ref $arrayOfRows)
  • ref $arrayOfRows: array $arrayOfRows
prune (line 133)

Goes through all the old versions of values and actually DELETES them from the database once commit() is called.

void prune (ref $versionConstraint)
  • ref $versionConstraint: object $versionConstraint A VersionConstraint)
reIndex (line 88)

Re-indexes all the values so that they start from 0 and increment by 1. Useful when indexes in the middle have been deleted.

  • access: public
void reIndex ()
setValueFromPrimitive (line 235)

Attempts to set the value of $index to $value. If the Record is version controlled, this will add a new version rather than set the existing value.

bool setValueFromPrimitive (int $index, ref $value)
  • int $index
  • ref $value: object $value A SObject object.
takeRow (line 51)

Takes a single row from a database and attempts to populate local objects.

void takeRow (ref $row)
  • ref $row: array $row
undeleteValue (line 292)

Re-activates the newest version of $index.

bool undeleteValue (int $index)
  • int $index
_checkObjectType (line 165)

Checks to make sure that the Primitive object is of the appropriate type for this label.

bool _checkObjectType (ref $object)
  • ref $object: object $object The Primitive object.
_getNextAvailableIndex (line 220)
void _getNextAvailableIndex ()

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