Class RecordManager

Description

The RecordManager handles the creation, tagging and fetching of Records from the database.

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

Located in /harmoni/core/dataManager/record/RecordManager.class.php (line 19)


	
			
Variable Summary
Method Summary
RecordManager RecordManager ()
void cacheRecordSet (ref $set, [boolean $force = false])
ref createRecord (string $type, [optional $verControl = false])
void deleteRecord (int $id, [optional $prune = false])
void deleteRecordSet (int $id, [optional $prune = false])
ref fetchRecord (int $id, [optional $mode = RECORD_CURRENT])
ref fetchRecords (array $IDs, [optional $mode = RECORD_CURRENT], [optional $limitResults = null])
ref fetchRecordSet (int $groupID, [optional $dontLoad = false])
ref getCachedRecordSet (int $id)
void getRecordIDsBySearch (ref $criteria, [optional $ids = null])
array getRecordIDsByType (string $type)
array getRecordSetIDsBySearch (ref $criteria, [optional $ids = null])
array getRecordSetIDsContaining (ref $record)
array getRecordSetIDsContainingID (int $id)
void loadRecordSets (array $groupIDsArray)
void preCacheRecordsFromRecordSetIDs (mixed $ids, [optional $fetchMode = RECORD_CURRENT], array $IDs)
void setCacheMode (boolean $mode)
void uncacheRecord (int $id)
void uncacheRecordSet (int $id)
void _setCacheMode (mixed $mode)
void _setupSelectQuery (ref $query, [optional $mode = RECORD_CURRENT])
Variables
mixed $_cacheMode (line 26)
mixed $_recordCache (line 23)
mixed $_recordSetCache (line 24)
mixed $_versionConstraint = null (line 21)
Methods
Constructor RecordManager (line 28)
RecordManager RecordManager ()
cacheRecordSet (line 87)

Puts the passed RecordSet into the internal cache.

  • access: public
void cacheRecordSet (ref $set, [boolean $force = false])
  • boolean $force: Re-cache even if we already have it cached. (default=no)
  • ref $set: object $set A RecordSet.
createRecord (line 584)

Returns a new Record object that can be inserted into the database.

  • return: object
ref createRecord (string $type, [optional $verControl = false])
  • string $type: The Schema type/ID that refers to the Schema to associate this Record with.
  • optional $verControl: bool $verControl Specifies if the Record should be created with Version Control. Default=no.
deleteRecord (line 484)

Deletes the Record of the Specified Id

void deleteRecord (int $id, [optional $prune = false])
  • int $id
  • optional $prune: bool $prune Set to TRUE if you want the Record to actually be pruned from the database and not just deactivated.
deleteRecordSet (line 502)

Delete the Record Set and any records that are referenced only by this record set and not shared with other record sets.

  • since: 10/6/04
  • access: public
void deleteRecordSet (int $id, [optional $prune = false])
  • int $id: The Id of the set to delete.
  • optional $prune: boolean $prune If TRUE will make sure that the Records are removed from the database.
fetchRecord (line 474)

Fetches a single Record from the database.

  • return: object
ref fetchRecord (int $id, [optional $mode = RECORD_CURRENT])
  • int $id
  • optional $mode: int $mode
fetchRecords (line 242)

Fetches and returns an array of Record IDs from the database in one Query.

  • return: array Indexed by Record ID, values are Records.
ref fetchRecords (array $IDs, [optional $mode = RECORD_CURRENT], [optional $limitResults = null])
  • array $IDs
  • optional $mode: int $mode Specifies the mode the record should be fetched.
  • optional $limitResults: object $limitResults NOT YET IMPLEMENTED criteria. If not specified, will fetch all IDs.
fetchRecordSet (line 55)

Returns a RecordSet object associated with the numeric ID.

  • return: object OR NULL if not found.
ref fetchRecordSet (int $groupID, [optional $dontLoad = false])
  • int $groupID: The RecordSet ID.
  • optional $dontLoad: bool $dontLoad If set to TRUE will not attempt to load the RecordSet, only return it if it's already loaded.
getCachedRecordSet (line 70)

Returns a cached RecordSet.

  • return: object
  • access: public
ref getCachedRecordSet (int $id)
  • int $id: The ID of the RecordSet.
getRecordIDsBySearch (line 360)

Takes an array of IDs and some search criteria, and weeds out the IDs that don't match that criteria.

  • access: public
void getRecordIDsBySearch (ref $criteria, [optional $ids = null])
  • ref $criteria: object $criteria The SearchCriteria.
  • optional $ids: array $ids An array of Record IDs to search among. If not specified, all records will be searched.
getRecordIDsByType (line 605)
array getRecordIDsByType (string $type)
  • string $type: The Schema type to look for. Returns an array of Record IDs that are of the Schema type $type.
getRecordSetIDsBySearch (line 412)

Takes an array of record set IDs and some search criteria, and weeds out the IDs that don't match that criteria.

  • access: public
array getRecordSetIDsBySearch (ref $criteria, [optional $ids = null])
  • ref $criteria: object $criteria The SearchCriteria.
  • optional $ids: array $ids An array of RecordSet IDs to search among. If not specified, all records will be searched.
getRecordSetIDsContaining (line 128)

Returns the Ids of all groups a Record is in.

  • return: An indexed array of the group ids (integers).
array getRecordSetIDsContaining (ref $record)
  • ref $record: object $record The Record.
getRecordSetIDsContainingID (line 138)

Returns the Ids of all groups a Record ID is in.

  • return: An indexed array of the group ids (integers).
array getRecordSetIDsContainingID (int $id)
  • int $id
loadRecordSets (line 164)

Loads the specified RecordSets into the cache.

void loadRecordSets (array $groupIDsArray)
  • array $groupIDsArray: An array of numeric IDs.
preCacheRecordsFromRecordSetIDs (line 221)

Pre-loads all of the records which are contained in the RecordSet IDs passed.

This is useful to speed up fetching records for multiple RecordSets

  • access: public
void preCacheRecordsFromRecordSetIDs (mixed $ids, [optional $fetchMode = RECORD_CURRENT], array $IDs)
  • array $IDs: An array of RecordSet ids.
  • optional $fetchMode: int $fetchMode the fetchmode to get the records (one of RECORD_*).
setCacheMode (line 40)

If set to true, records will be cached, otherwise not.

  • static:
void setCacheMode (boolean $mode)
  • boolean $mode
uncacheRecord (line 118)

Removes a record from the cache.

  • access: public
void uncacheRecord (int $id)
  • int $id: The ID of the record.
uncacheRecordSet (line 102)

Removes a recordset (and all of its records!) from the cache.

  • access: public
void uncacheRecordSet (int $id)
  • int $id: The ID of the record set.
_setCacheMode (line 45)
void _setCacheMode (mixed $mode)
_setupSelectQuery (line 541)

Initializes a SelectQuery with the complex JOIN structures of the DataManager.

  • access: private
void _setupSelectQuery (ref $query, [optional $mode = RECORD_CURRENT])
  • ref $query: object $query
  • optional $mode: int $mode Specifies the mode we are fetching our results. Must be one of RESULT_* constants.

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