CSOpenSearchAreaMapping
in package
Represents a Open Search Area Mapping Contains APIs for OpenSearchAreaMapping
Tags
Table of Contents
- RECORD_CHUNK_SIZE = 10000
- SQL_OPERATION_ADDITION = '+'
- SQL_OPERATION_SUBTRACTION = '-'
- __construct() : mixed
- CSOpenSearchAreaMapping constructor.
- addMapping() : int
- Adds mapping for mentioned parameters.
- addUniqueMapping() : mixed
- Adds mapping for mentioned parameters. If the mapping is already present in the database for the provided parameters then new mapping will not be added for same parameters.
- deleteAllMappings() : mixed
- Deletes all the mappings for specific OpenSearchAreaID
- deleteMappings() : mixed
- Deletes the mappings with specified Record ID and Class ID
- deleteMappingsForRecordsWithClass() : array<string|int, mixed>
- Deletes the mappings with specified Class ID, and Record ID.
- deleteMappingsForReference() : bool
- Deletes the mappings with specified Source Record ID, Source Class ID, Class ID, and Record ID
- deletesMappingsBySource() : mixed
- Deletes the mappings with specified Source Record ID and Class ID
- getAllMappings() : Table
- Gets the mappings for specific OpenSearchAreaID
- getAllSourcesByRecord() : Table
- Gets mappings for specific referenced record.
- getMappings() : Table
- Gets the mappings for specified Record ID and Class ID.
- getMappingsBySource() : Table
- Gets the mappings for specified Source Record ID and ClassID.
- getMaxSortOrder() : int
- Gets highest sort order value in selected Search Area.
- getSearchAreaReferenceList() : Table
- Gets mappings for all referenced record in selected area.
- setSortOrders() : bool
- Updates the sort order for specified Record ID amd Class ID
Constants
RECORD_CHUNK_SIZE
public
mixed
RECORD_CHUNK_SIZE
= 10000
Tags
SQL_OPERATION_ADDITION
public
mixed
SQL_OPERATION_ADDITION
= '+'
Tags
SQL_OPERATION_SUBTRACTION
public
mixed
SQL_OPERATION_SUBTRACTION
= '-'
Tags
Methods
__construct()
CSOpenSearchAreaMapping constructor.
public
__construct(int $iOpenSearchAreaId) : mixed
Parameters
- $iOpenSearchAreaId : int
-
ID of Open Search Area
Tags
Return values
mixed —addMapping()
Adds mapping for mentioned parameters.
public
addMapping(int $iRecordID, int $iClassID, int $iSourceRecordID, int $iSourceClassID, int $iSourceFieldID[, int $iSortOrder = 1 ][, int $sCreationDate = '' ]) : int
Parameters
- $iRecordID : int
-
ID of record
- $iClassID : int
-
ID of class
- $iSourceRecordID : int
-
ID of source record
- $iSourceClassID : int
-
ID of source record class
- $iSourceFieldID : int
-
ID of source field
- $iSortOrder : int = 1
-
Sort order of record
- $sCreationDate : int = ''
-
creation date
Tags
Return values
int —the added mapping id.
addUniqueMapping()
Adds mapping for mentioned parameters. If the mapping is already present in the database for the provided parameters then new mapping will not be added for same parameters.
public
addUniqueMapping(int $iRecordID, int $iClassID, int $iSourceRecordID, int $iSourceClassID, int $iSourceFieldID, int $iSortOrder[, int $sCreationDate = '' ]) : mixed
Parameters
- $iRecordID : int
-
ID of record
- $iClassID : int
-
ID of class
- $iSourceRecordID : int
-
ID of source record
- $iSourceClassID : int
-
ID of source record class
- $iSourceFieldID : int
-
ID of source field
- $iSortOrder : int
-
Sort order of record
- $sCreationDate : int = ''
-
creation date
Tags
Return values
mixed —deleteAllMappings()
Deletes all the mappings for specific OpenSearchAreaID
public
deleteAllMappings() : mixed
Tags
Return values
mixed —deleteMappings()
Deletes the mappings with specified Record ID and Class ID
public
deleteMappings(int $iRecordID, int $iClassID) : mixed
Parameters
- $iRecordID : int
-
ID of record
- $iClassID : int
-
ID of class
Tags
Return values
mixed —deleteMappingsForRecordsWithClass()
Deletes the mappings with specified Class ID, and Record ID.
public
deleteMappingsForRecordsWithClass(array<string|int, mixed> $aMappings) : array<string|int, mixed>
We are deleting mapping in batch of 1000 so as to avoid query execution failure.
Parameters
- $aMappings : array<string|int, mixed>
-
Array of items which contains Record ID and Class ID
Tags
Return values
array<string|int, mixed> —Deleted items
deleteMappingsForReference()
Deletes the mappings with specified Source Record ID, Source Class ID, Class ID, and Record ID
public
deleteMappingsForReference(int $iRecordID, int $iClassID, int $iSourceRecordID, int $iSourceClassID) : bool
Parameters
- $iRecordID : int
-
ID of record
- $iClassID : int
-
ID of class
- $iSourceRecordID : int
-
ID of source record
- $iSourceClassID : int
-
ID of source record class
Tags
Return values
bool —the status of the delete mapping.
deletesMappingsBySource()
Deletes the mappings with specified Source Record ID and Class ID
public
deletesMappingsBySource(int $iSourceRecordID, int $iSourceClassID) : mixed
Parameters
- $iSourceRecordID : int
-
ID of source record
- $iSourceClassID : int
-
ID of source record class
Tags
Return values
mixed —getAllMappings()
Gets the mappings for specific OpenSearchAreaID
public
getAllMappings() : Table
Tags
Return values
Table —getAllSourcesByRecord()
Gets mappings for specific referenced record.
public
getAllSourcesByRecord(int $iRecordID, int $iClassID) : Table
Parameters
- $iRecordID : int
-
ID of record
- $iClassID : int
-
ID of record class
Tags
Return values
Table —getMappings()
Gets the mappings for specified Record ID and Class ID.
public
getMappings(int $iRecordID, int $iClassID) : Table
Parameters
- $iRecordID : int
-
ID of record
- $iClassID : int
-
ID of class
Tags
Return values
Table —getMappingsBySource()
Gets the mappings for specified Source Record ID and ClassID.
public
getMappingsBySource(int $iSourceRecordID, int $iSourceClassID) : Table
Parameters
- $iSourceRecordID : int
-
ID of source record
- $iSourceClassID : int
-
ID of source record class
Tags
Return values
Table —getMaxSortOrder()
Gets highest sort order value in selected Search Area.
public
getMaxSortOrder() : int
Tags
Return values
int —Containing highest sort order
getSearchAreaReferenceList()
Gets mappings for all referenced record in selected area.
public
getSearchAreaReferenceList() : Table
Tags
Return values
Table —containing referenced records
setSortOrders()
Updates the sort order for specified Record ID amd Class ID
public
setSortOrders(array<string|int, mixed> $aData) : bool
Parameters
- $aData : array<string|int, mixed>
-
contains record ID, class ID and respective sort order
Tags
Return values
bool —returns true if successful else false.
