RecordManager
RecordManager
()
Puts the passed RecordSet into the internal cache.
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.
Returns a new Record object that can be inserted into the database.
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.
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.
Delete the Record Set and any records that are referenced only by this record set and not shared with other record sets.
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.
Fetches a single Record from the database.
ref
fetchRecord
(int $id, [optional $mode = RECORD_CURRENT])
-
int
$id
-
optional
$mode: int $mode
Fetches and returns an array of Record IDs from the database in one Query.
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.
Returns a RecordSet object associated with the numeric ID.
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.
Returns a cached RecordSet.
ref
getCachedRecordSet
(int $id)
-
int
$id: The ID of the RecordSet.
Takes an array of IDs and some search criteria, and weeds out the IDs that don't match that criteria.
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.
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.
Takes an array of record set IDs and some search criteria, and weeds out the IDs that don't match that criteria.
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.
Returns the Ids of all groups a Record is in.
array
getRecordSetIDsContaining
(ref $record)
-
ref
$record: object $record The Record.
Returns the Ids of all groups a Record ID is in.
array
getRecordSetIDsContainingID
(int $id)
Loads the specified RecordSets into the cache.
void
loadRecordSets
(array $groupIDsArray)
-
array
$groupIDsArray: An array of numeric IDs.
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
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_*).
If set to true, records will be cached, otherwise not.
void
setCacheMode
(boolean $mode)
Removes a record from the cache.
void
uncacheRecord
(int $id)
-
int
$id: The ID of the record.
Removes a recordset (and all of its records!) from the cache.
void
uncacheRecordSet
(int $id)
-
int
$id: The ID of the record set.
void
_setCacheMode
(mixed $mode)
Initializes a SelectQuery with the complex JOIN structures of the DataManager.
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.