CSOpenSearchArea
in package
Tags
Table of Contents
- ACTION_DOWNLOAD = 'download'
- ACTION_EDIT = 'edit'
- ACTION_VIEW = 'view'
- CS_SORT_BY_CONFIGURATION = 0
- CS_SORT_BY_MANUAL_SORT = 1
- OPENSEARCH_AREA_ID_ALL_SHARES = -2
- OPENSEARCH_AREA_ID_EVERYWHERE = -1
- OPENSEARCH_AREA_ID_MY_FILES = -3
- SELECTION_TYPE_BY_FAVORITE = 1
- SELECTION_TYPE_BY_ROOT_IDS = 0
- TYPE_OPEN_SEARCH_AREA = 1
- Different open search types
- TYPE_OPEN_SEARCH_AREA_AND_OPEN_SHARE = 4
- TYPE_OPEN_SEARCH_TEMPLATE = 3
- TYPE_OPEN_SHARE = 2
- TYPE_SORT_ASC = 0
- Constant for sort type while creating search area object.
- URL_TYPE_DOWNLOAD = 'download'
- URL_TYPE_HTML_VIEW = 'view'
- USER_ACCESS_ALL_KNOWN_USERS = 0
- USER_ACCESS_ALL_USERS = 1
- USER_ACCESS_FOLLOWING_USERS = 2
- VIEW_TYPE_ALWAYS = 0
- VIEW_TYPE_ON_DEMAND = 1
- __construct() : mixed
- The Constructor
- __destruct() : mixed
- Removes instance vars of the type objects to eliminate memory leaks
- addMapping() : int
- Calls addMapping method of OpenSearchAreaMapping class
- addSearchAreaType() : void
- Add SearchArea type(s) for Record
- addUniqueMapping() : mixed
- Calls addUniqueMapping method of OpenSearchAreaMapping class
- deleteAllMappings() : mixed
- Calls deleteAllMappings method of OpenSearchAreMapping class
- deleteMappings() : mixed
- Deletes the mappings with specified Record ID and Class ID
- deleteMappingsBySource() : mixed
- Calls deleteMappingBySource method of OpenSearchAreaMapping class
- 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
- getAllMappings() : Table|array<string|int, OpenSearchAreaMapping>
- Calls getAllMappings method of OpenSearchAreaMapping class
- getAllSharesSearchArea() : CSOpenSearchArea
- This method returns the All Shares opensearch area object
- getAllSourcesByRecord() : Table
- Gets mappings for specific referenced record.
- getCacheMinutes() : int
- Returns the time in minutes for which the area search results could be cached
- getClass() : string
- Returns class name for Open Search Area
- getClassID() : string
- Returns the Class Id for given ClassName
- getClassName() : string
- Returns the object of OpenSearchAreaMapping class
- getCreatedAt() : string
- Tells when the search areas was created
- getCreatedBy() : int
- Returns the UserID of the User which created the area
- getCSSLink() : string
- The Search Area may return here an relative or absolute link to a CSS file if they wish This link will be added to the Search GUI. Use CS::getLinkToResource(url, format) with the format param absolute or relative to generate a link that can be used within any REST url
- getData() : array<string|int, mixed>
- Returns the internal records data of the OpenSearchArea
- getDefaultSearchOrder() : string
- Returns the search order that should be applied if no search query is used
- getDefaultSearchQuery() : string
- Returns the search term that should be applied if no search query is used
- getEverywhereSearchArea() : CSOpenSearchArea
- This method returns the everywhere opensearch area object
- getID() : int
- Retrieves the ID of the area
- getIDField() : string
- Returns name of field for "ID" of Open Search Area.
- getLabel() : string
- Retrieves the label of the search area as it is displayed in the search GUI. Here if we pass null then we will return plain label without translation else the flow to translate the value will be like TMS Dict-> Module Dict-> Project Dict (if the label translation is present in TMS, it will not go further to check Module value, same goes for module and Project)
- getLabelByRequest() : string
- Returns translated label of an area taking the given Request (CSOpenSearchRequest) into account.
- getLabelField() : string
- Returns name of field for "Label" of Open Search Area.
- getMappings() : Table
- Calls getMappings method of OpenSearchAreaMapping class
- getMappingsBySource() : Table
- Calls getMappingBySource method of OpenSearchAreaMapping class
- getMaxSortOrder() : int
- Gets highest sort order value in selected Search Area.
- getMyFilesSearchArea() : CSOpenSearchArea
- This method returns the My Files opensearch area object
- getOpenKey() : string
- Returns the OpenKey of this area if any exists
- getOpenSearchArea() : CSOpenSearchArea
- Returns an open search area for a given id.
- getOwnerID() : int
- Returns the current Owner of an area.
- getPreviewHtml() : string
- Allows the Plugin to provide some html that should be displayed as preview of an item
- getRunAsUserId() : int
- Gets the UserAvatarID (RunAsUserId) attribute.
- getSearchAreaPlugin() : CSOpenSearchAreaPlugin
- Retrieves the search area plugin
- getSearchAreaPluginField() : string
- Returns name of field for "SearchAreaPlugin" of Open Search Area.
- getSearchAreaPluginName() : string
- This method returns the search area plugin name.
- getSearchAreaReferenceList() : Table
- Returns all the reference items list with respect to search area.
- getSearchAreaTypeField() : string
- Returns name of field for "SearchAreaType" of Open Search Area.
- getSortOrder() : mixed
- Returns the sort order of a search area
- getTabVisibility() : bool
- Returns the Value of ShowAsTab property of the current search area.
- getTileTitle() : string
- Returns "Tile Title" for Search Area.
- getUrl() : string
- Returns the open search url.
- getUserAccess() : int
- Gets the UserAccess level.
- getUserAccessFormatted() : string
- Gets the UserAccess type in a human readable format
- getUserAccessIds() : array<string|int, mixed>
- Returns the UserIDs that should have access to this area
- getUserIDs() : string
- Returns the UserIDs that should have access to this area
- getValue() : string
- Generic method to read a named database value from the search area
- getViewType() : int
- Returns the View Type
- hasSearchAreaType() : bool
- Check if the Record has SearchArea type(s)
- isAllowedTo() : bool
- Checks the given right.
- isAllowedToCreate() : bool
- Check if the User is allowed to create.
- isAllowedToDelete() : bool
- Check if the user is allowed to delete.
- isAllowedToEdit() : bool
- Checks if the User is allowed to edit.
- isAllowedToEditAllAreasForFrontend() : bool
- Checks the right of edit all Areas ONLY for Frontend.
- isAllowedToEditByOwnerForFrontend() : bool
- Check the right to edit only own Areas for Frontend.
- isAllowedToViewForFrontend() : bool
- Check the right to view area ONLY for Frontend.
- isAvailable() : bool
- Checks is an OpenSearchArea is available for the current user at the current time
- isAvailableForCurrentUser() : bool
- Check if the current user is allowed to use the search area First, this method checks the value of the field UserAccess UserAccess==0, means all users but Anonymous have access to the search area UserAccess==1, means all users including Anonymous have access to the search area UserAccess==2, means only Users with UserIDs mentioned in the chooser have access to the search area
- isDisabled() : bool
- Tells if the preset has the "Disabled" checkbox set in the preset configuration
- isEditableForCurrentUser() : bool
- Returns Object Edit state
- isEnabled() : bool
- Tells if the Open Search Area has the "Enabled" checkbox set in the configuration
- isManuallySortable() : string
- Returns the sort type of a search area
- isManuallySorted() : bool
- Returns whether current Search Area is manually sorted by User, TRUE if manually sorted by User otherwise FALSE.
- isOpenShare() : bool
- Tells if the area is used as open share
- isSearchSuggestion() : bool
- Returns if the SearchSuggestion is set.
- isTemplate() : bool
- Returns whether the open search area is a template.
- isType() : bool
- Tests if the search area matches the specified type
- isValid() : bool
- Returns True if Search Area is valid for current time, otherwise FALSE
- removeSearchAreaType() : void
- Remove SearchArea type(s) from Record
- search() : void
- This is the most important method to implement when defining your CSOpenSearch
- setCacheMinutes() : mixed
- Sets the time in minutes for which the area search results could be cached
- setDefaultSearchOrder() : void
- Sets the search order that should be applied if no search query is used
- setDefaultSearchQuery() : mixed
- Sets the search term that should be applied if no search query is used
- setEditableForCurrentUser() : mixed
- Set object editable
- setIsManuallySorted() : mixed
- Set the "IsManuallySorted" field value with given value.
- setLabel() : mixed
- Sets the label of the search area
- setOpenKey() : void
- Overwrites the OpenKey for this area
- setOwnerID() : void
- Sets the OwnerID on an area.
- setResponseItems() : void
- Add the OpenSearchItems to the Response
- setRunAsUserId() : mixed
- Sets the UserAvatarID (RunAsUserId) attribute.
- setSearchAreaPlugin() : mixed
- Sets the search area plugin
- setSearchAreaPluginName() : void
- Sets the plugin associated with this area
- setSearchSuggestion() : void
- Sets the value for the SearchSuggestion.
- setSelectModeResponseItems() : void
- Add the CSOpenSearchItem object to the Response for activated SelectMode
- setSortOrder() : void
- Sets ths sort order of an search area
- setSortOrders() : bool
- Calls setSortOrders method of OpenSearchAreaMapping class
- setTabVisibility() : mixed
- Sets the given value for ShowAsTab property of the current search area.
- setUserAccess() : void
- Set the UserAccess attribute.
- setValue() : void
- Generic setter method used by the explicit setter methods to set values in the database record of this area
- setViewType() : mixed
- Sets the View Type
- shouldUseSearchSuggestion() : void
- Defines if the open search area should use search suggestions.
- store() : void
- Stores the underlying record to the database
- usesSearchSuggestion() : bool
- Returns whether the open search area uses search suggestions.
Constants
ACTION_DOWNLOAD
public
mixed
ACTION_DOWNLOAD
= 'download'
Tags
ACTION_EDIT
public
mixed
ACTION_EDIT
= 'edit'
Tags
ACTION_VIEW
public
mixed
ACTION_VIEW
= 'view'
Tags
CS_SORT_BY_CONFIGURATION
public
mixed
CS_SORT_BY_CONFIGURATION
= 0
Tags
CS_SORT_BY_MANUAL_SORT
public
mixed
CS_SORT_BY_MANUAL_SORT
= 1
Tags
OPENSEARCH_AREA_ID_ALL_SHARES
public
mixed
OPENSEARCH_AREA_ID_ALL_SHARES
= -2
Tags
OPENSEARCH_AREA_ID_EVERYWHERE
public
mixed
OPENSEARCH_AREA_ID_EVERYWHERE
= -1
Tags
OPENSEARCH_AREA_ID_MY_FILES
public
mixed
OPENSEARCH_AREA_ID_MY_FILES
= -3
Tags
SELECTION_TYPE_BY_FAVORITE
public
mixed
SELECTION_TYPE_BY_FAVORITE
= 1
Tags
SELECTION_TYPE_BY_ROOT_IDS
public
mixed
SELECTION_TYPE_BY_ROOT_IDS
= 0
Tags
TYPE_OPEN_SEARCH_AREA
Different open search types
public
mixed
TYPE_OPEN_SEARCH_AREA
= 1
Tags
TYPE_OPEN_SEARCH_AREA_AND_OPEN_SHARE
public
mixed
TYPE_OPEN_SEARCH_AREA_AND_OPEN_SHARE
= 4
Tags
TYPE_OPEN_SEARCH_TEMPLATE
public
mixed
TYPE_OPEN_SEARCH_TEMPLATE
= 3
Tags
TYPE_OPEN_SHARE
public
mixed
TYPE_OPEN_SHARE
= 2
Tags
TYPE_SORT_ASC
Constant for sort type while creating search area object.
public
mixed
TYPE_SORT_ASC
= 0
It is used by Elastic Search internally to sort result based on following constant provided.
Tags
URL_TYPE_DOWNLOAD
public
mixed
URL_TYPE_DOWNLOAD
= 'download'
Tags
URL_TYPE_HTML_VIEW
public
mixed
URL_TYPE_HTML_VIEW
= 'view'
Tags
USER_ACCESS_ALL_KNOWN_USERS
public
mixed
USER_ACCESS_ALL_KNOWN_USERS
= 0
Tags
USER_ACCESS_ALL_USERS
public
mixed
USER_ACCESS_ALL_USERS
= 1
Tags
USER_ACCESS_FOLLOWING_USERS
public
mixed
USER_ACCESS_FOLLOWING_USERS
= 2
Tags
VIEW_TYPE_ALWAYS
public
mixed
VIEW_TYPE_ALWAYS
= 0
Tags
VIEW_TYPE_ON_DEMAND
public
mixed
VIEW_TYPE_ON_DEMAND
= 1
Tags
Methods
__construct()
The Constructor
public
__construct(mixed $mSearchAreaID) : mixed
Parameters
- $mSearchAreaID : mixed
-
The ID of the search area
Tags
Return values
mixed —__destruct()
Removes instance vars of the type objects to eliminate memory leaks
public
__destruct() : mixed
Tags
Return values
mixed —addMapping()
Calls addMapping method of OpenSearchAreaMapping class
public
addMapping(int $iRecordID, int $iClassID, int $iSourceRecordID, int $iSourceClassID, int $iSourceFieldID[, int $iSortOrder = 1 ][, string $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 : string = ''
-
creation date
Tags
Return values
int —the added mapping id.
addSearchAreaType()
Add SearchArea type(s) for Record
public
addSearchAreaType(int $iSearchAreaTypes) : void
Parameters
- $iSearchAreaTypes : int
-
SearchArea type(s) to add
Tags
Return values
void —addUniqueMapping()
Calls addUniqueMapping method of OpenSearchAreaMapping class
public
addUniqueMapping(int $iRecordID, int $iClassID, int $iSourceRecordID, int $iSourceClassID, int $iSourceFieldID, int $iSortOrder[, string $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 : string = ''
-
creation date
Tags
Return values
mixed —deleteAllMappings()
Calls deleteAllMappings method of OpenSearchAreMapping class
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 record class
Tags
Return values
mixed —deleteMappingsBySource()
Calls deleteMappingBySource method of OpenSearchAreaMapping class
public
deleteMappingsBySource(int $iSourceRecordID, int $iSourceClassID) : mixed
Parameters
- $iSourceRecordID : int
-
ID of source record
- $iSourceClassID : int
-
ID of source record 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>
Parameters
- $aMappings : array<string|int, mixed>
-
Array of items which contains Record ID and Class ID
Tags
Return values
array<string|int, mixed> —list of 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.
getAllMappings()
Calls getAllMappings method of OpenSearchAreaMapping class
public
getAllMappings() : Table|array<string|int, OpenSearchAreaMapping>
Tags
Return values
Table|array<string|int, OpenSearchAreaMapping> —getAllSharesSearchArea()
This method returns the All Shares opensearch area object
public
static getAllSharesSearchArea() : CSOpenSearchArea
Tags
Return values
CSOpenSearchArea —CSOpenSearchArea Object of All Shares open search area
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 —getCacheMinutes()
Returns the time in minutes for which the area search results could be cached
public
getCacheMinutes([bool $bCheckPermission = true ]) : int
Parameters
- $bCheckPermission : bool = true
-
If it should check CSOpenSearch::shouldAllowCaching()
Tags
Return values
int —The minutes
getClass()
Returns class name for Open Search Area
public
getClass() : string
Tags
Return values
string —Class name for Open Search Area.
getClassID()
Returns the Class Id for given ClassName
public
static getClassID(string $sClassName) : string
Parameters
- $sClassName : string
-
name of the class
Tags
Return values
string —getClassName()
Returns the object of OpenSearchAreaMapping class
public
getClassName(string $iClassID) : string
Parameters
- $iClassID : string
-
id of the class
Tags
Return values
string —getCreatedAt()
Tells when the search areas was created
public
getCreatedAt() : string
Tags
Return values
string —the formatted time
getCreatedBy()
Returns the UserID of the User which created the area
public
getCreatedBy() : int
Tags
Return values
int —the Creators UserID
getCSSLink()
The Search Area may return here an relative or absolute link to a CSS file if they wish This link will be added to the Search GUI. Use CS::getLinkToResource(url, format) with the format param absolute or relative to generate a link that can be used within any REST url
public
getCSSLink() : string
Tags
Return values
string —The link with an absolute or relative url
getData()
Returns the internal records data of the OpenSearchArea
public
getData() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getDefaultSearchOrder()
Returns the search order that should be applied if no search query is used
public
getDefaultSearchOrder() : string
Tags
Return values
string —The empty search order
getDefaultSearchQuery()
Returns the search term that should be applied if no search query is used
public
getDefaultSearchQuery() : string
Tags
Return values
string —The default search query
getEverywhereSearchArea()
This method returns the everywhere opensearch area object
public
static getEverywhereSearchArea() : CSOpenSearchArea
Tags
Return values
CSOpenSearchArea —Object of Everywhere open search area
getID()
Retrieves the ID of the area
public
getID() : int
Tags
Return values
int —The ID of the area
getIDField()
Returns name of field for "ID" of Open Search Area.
public
getIDField() : string
Tags
Return values
string —Name of field for ID of Search Area.
getLabel()
Retrieves the label of the search area as it is displayed in the search GUI. Here if we pass null then we will return plain label without translation else the flow to translate the value will be like TMS Dict-> Module Dict-> Project Dict (if the label translation is present in TMS, it will not go further to check Module value, same goes for module and Project)
public
getLabel(int $mLanguage) : string
Parameters
- $mLanguage : int
-
The optional languages if the search area should be translated
Tags
Return values
string —The label
getLabelByRequest()
Returns translated label of an area taking the given Request (CSOpenSearchRequest) into account.
public
getLabelByRequest(CSOpenSearchRequest $oRequest) : string
Parameters
- $oRequest : CSOpenSearchRequest
Tags
Return values
string —getLabelField()
Returns name of field for "Label" of Open Search Area.
public
getLabelField() : string
Tags
Return values
string —Name of field for Label of Search Area.
getMappings()
Calls getMappings method of OpenSearchAreaMapping class
public
getMappings(int $iRecordID, int $iClassID) : Table
Parameters
- $iRecordID : int
-
ID of record
- $iClassID : int
-
ID of class
Tags
Return values
Table —getMappingsBySource()
Calls getMappingBySource method of OpenSearchAreaMapping class
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
getMyFilesSearchArea()
This method returns the My Files opensearch area object
public
static getMyFilesSearchArea() : CSOpenSearchArea
Tags
Return values
CSOpenSearchArea —CSOpenSearchArea Object of My Files open search area
getOpenKey()
Returns the OpenKey of this area if any exists
public
getOpenKey() : string
Tags
Return values
string —the OpenKey
getOpenSearchArea()
Returns an open search area for a given id.
public
static getOpenSearchArea(int|string $mSearchAreaId) : CSOpenSearchArea
Parameters
- $mSearchAreaId : int|string
Tags
Return values
CSOpenSearchArea —getOwnerID()
Returns the current Owner of an area.
public
getOwnerID() : int
Tags
Return values
int —getPreviewHtml()
Allows the Plugin to provide some html that should be displayed as preview of an item
public
getPreviewHtml(string $iId, CSOpenSearchRequest $oRequest) : string
Parameters
- $iId : string
-
The ID that was provided with the addItem Method in the @see search method
- $oRequest : CSOpenSearchRequest
Tags
Return values
string —Html code that can be embedded via Ajax call in the search window
getRunAsUserId()
Gets the UserAvatarID (RunAsUserId) attribute.
public
getRunAsUserId() : int
Tags
Return values
int —UserAvatarID (RunAsUserId) attribute
getSearchAreaPlugin()
Retrieves the search area plugin
public
getSearchAreaPlugin() : CSOpenSearchAreaPlugin
Tags
Return values
CSOpenSearchAreaPlugin —getSearchAreaPluginField()
Returns name of field for "SearchAreaPlugin" of Open Search Area.
public
getSearchAreaPluginField() : string
Tags
Return values
string —Name of field for Plugin of Search Area.
getSearchAreaPluginName()
This method returns the search area plugin name.
public
getSearchAreaPluginName() : string
Tags
Return values
string —with the search area plugin name.
getSearchAreaReferenceList()
Returns all the reference items list with respect to search area.
public
getSearchAreaReferenceList() : Table
Tags
Return values
Table —Contains reference items list
getSearchAreaTypeField()
Returns name of field for "SearchAreaType" of Open Search Area.
public
getSearchAreaTypeField() : string
Tags
Return values
string —Name of field for Type of Search Area.
getSortOrder()
Returns the sort order of a search area
public
getSortOrder() : mixed
Tags
Return values
mixed —getTabVisibility()
Returns the Value of ShowAsTab property of the current search area.
public
getTabVisibility() : bool
Tags
Return values
bool —Value of ShowAsTab property of the current search area.
getTileTitle()
Returns "Tile Title" for Search Area.
public
getTileTitle(int|null $iLanguageId) : string
Parameters
- $iLanguageId : int|null
-
If the language id is NULL the original tile title will be returned. If the language id is 0 the tile title will be returned with the current language.
Tags
Return values
string —Tile Title for Search Area.
getUrl()
Returns the open search url.
public
getUrl([string $type = self::URL_TYPE_HTML_VIEW ][, null $UserID = null ][, string $base = 'external' ]) : string
Parameters
- $type : string = self::URL_TYPE_HTML_VIEW
-
The type of the url. See constants "CSOpenSearchArea::URL_TYPE*"
- $UserID : null = null
-
The user id.
- $base : string = 'external'
-
The base of the url.
Tags
Return values
string —with the open search url.
getUserAccess()
Gets the UserAccess level.
public
getUserAccess() : int
- USER_ACCESS_FOLLOWING_USERS
- USER_ACCESS_ALL_USERS
- USER_ACCESS_ALL_KNOWN_USERS
Tags
Return values
int —UserAccess level
getUserAccessFormatted()
Gets the UserAccess type in a human readable format
public
getUserAccessFormatted() : string
Tags
Return values
string —UserAccess
getUserAccessIds()
Returns the UserIDs that should have access to this area
public
getUserAccessIds() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —An array with the user ids.
getUserIDs()
Returns the UserIDs that should have access to this area
public
getUserIDs() : string
Tags
Return values
string —A comma separated string of UserIDs
getValue()
Generic method to read a named database value from the search area
public
getValue(string $name) : string
Parameters
- $name : string
-
The name of the value
Tags
Return values
string —The value
getViewType()
Returns the View Type
public
getViewType() : int
Tags
Return values
int —the view type
hasSearchAreaType()
Check if the Record has SearchArea type(s)
public
hasSearchAreaType(int $iSearchAreaType) : bool
Parameters
- $iSearchAreaType : int
-
SearchArea type(s) to query the record
Tags
Return values
bool —isAllowedTo()
Checks the given right.
public
isAllowedTo(string $sRight[, null|int $iUserId = null ]) : bool
Parameters
- $sRight : string
- $iUserId : null|int = null
Tags
Return values
bool —isAllowedToCreate()
Check if the User is allowed to create.
public
isAllowedToCreate([null|int $iUserId = null ]) : bool
Parameters
- $iUserId : null|int = null
Tags
Return values
bool —isAllowedToDelete()
Check if the user is allowed to delete.
public
isAllowedToDelete([null|int $iUserId = null ]) : bool
Parameters
- $iUserId : null|int = null
Tags
Return values
bool —isAllowedToEdit()
Checks if the User is allowed to edit.
public
isAllowedToEdit([null|int $iUserId = null ]) : bool
Parameters
- $iUserId : null|int = null
Tags
Return values
bool —isAllowedToEditAllAreasForFrontend()
Checks the right of edit all Areas ONLY for Frontend.
public
isAllowedToEditAllAreasForFrontend([null|int $iUserId = null ]) : bool
Parameters
- $iUserId : null|int = null
Tags
Return values
bool —isAllowedToEditByOwnerForFrontend()
Check the right to edit only own Areas for Frontend.
public
isAllowedToEditByOwnerForFrontend([null|int $iUserId = null ]) : bool
Parameters
- $iUserId : null|int = null
Tags
Return values
bool —isAllowedToViewForFrontend()
Check the right to view area ONLY for Frontend.
public
isAllowedToViewForFrontend([null|int $iUserId = null ]) : bool
Parameters
- $iUserId : null|int = null
Tags
Return values
bool —isAvailable()
Checks is an OpenSearchArea is available for the current user at the current time
public
isAvailable() : bool
Tags
Return values
bool —true if the search area is available
isAvailableForCurrentUser()
Check if the current user is allowed to use the search area First, this method checks the value of the field UserAccess UserAccess==0, means all users but Anonymous have access to the search area UserAccess==1, means all users including Anonymous have access to the search area UserAccess==2, means only Users with UserIDs mentioned in the chooser have access to the search area
public
isAvailableForCurrentUser() : bool
Tags
Return values
bool —Current user allowed to use the search area
isDisabled()
Tells if the preset has the "Disabled" checkbox set in the preset configuration
public
isDisabled() : bool
Tags
Return values
bool —TRUE if the preset is disabled
isEditableForCurrentUser()
Returns Object Edit state
public
isEditableForCurrentUser() : bool
Tags
Return values
bool —object edit state
isEnabled()
Tells if the Open Search Area has the "Enabled" checkbox set in the configuration
public
isEnabled() : bool
Tags
Return values
bool —if the Open Search Area is enabled
isManuallySortable()
Returns the sort type of a search area
public
isManuallySortable() : string
Tags
Return values
string —The sort Type
isManuallySorted()
Returns whether current Search Area is manually sorted by User, TRUE if manually sorted by User otherwise FALSE.
public
isManuallySorted() : bool
Tags
Return values
bool —Whether current Search Area is manually sorted by User.
isOpenShare()
Tells if the area is used as open share
public
isOpenShare() : bool
Tags
Return values
bool —true if this is an open share
isSearchSuggestion()
Returns if the SearchSuggestion is set.
public
isSearchSuggestion() : bool
Tags
Return values
bool —isTemplate()
Returns whether the open search area is a template.
public
isTemplate() : bool
Tags
Return values
bool —whether the open search area is a template.
isType()
Tests if the search area matches the specified type
public
isType(int $iSearchAreaType) : bool
Parameters
- $iSearchAreaType : int
-
Search area type to be tested against. It must be a constant from family CSOpenSearchConst::SEARCHAREA_TYPE_*
Tags
Return values
bool —TRUE if the search area matches the specified type FALSE, Otherwise.
isValid()
Returns True if Search Area is valid for current time, otherwise FALSE
public
isValid() : bool
Tags
Return values
bool —True if Search Area is valid, otherwise FALSE
removeSearchAreaType()
Remove SearchArea type(s) from Record
public
removeSearchAreaType(int $iSearchAreaTypes) : void
Parameters
- $iSearchAreaTypes : int
-
SearchArea type(s) to remove
Tags
Return values
void —search()
This is the most important method to implement when defining your CSOpenSearch
public
search(CSOpenSearchRequest $oRequest, CSOpenSearchResponse $oResponse) : void
Parameters
- $oRequest : CSOpenSearchRequest
-
The search request
- $oResponse : CSOpenSearchResponse
-
The search response
Tags
Return values
void —setCacheMinutes()
Sets the time in minutes for which the area search results could be cached
public
setCacheMinutes(int $iMinutes) : mixed
Parameters
- $iMinutes : int
-
The minutes
Tags
Return values
mixed —setDefaultSearchOrder()
Sets the search order that should be applied if no search query is used
public
setDefaultSearchOrder(string $sDefaultSearch) : void
Parameters
- $sDefaultSearch : string
-
A SQL-Like sort order if no search is entered in UI
Tags
Return values
void —setDefaultSearchQuery()
Sets the search term that should be applied if no search query is used
public
setDefaultSearchQuery(string $sDefaultSearchQuery) : mixed
Parameters
- $sDefaultSearchQuery : string
-
A SQL-Like search term if no search is entered in UI
Tags
Return values
mixed —setEditableForCurrentUser()
Set object editable
public
setEditableForCurrentUser([bool $bEditable = false ]) : mixed
Parameters
- $bEditable : bool = false
Tags
Return values
mixed —setIsManuallySorted()
Set the "IsManuallySorted" field value with given value.
public
setIsManuallySorted(bool $bManuallySorted) : mixed
TRUE is manually sorted by User else FALSE.
Parameters
- $bManuallySorted : bool
-
TRUE is manually sorted by User else FALSE.
Tags
Return values
mixed —setLabel()
Sets the label of the search area
public
setLabel(string $sLabel) : mixed
Parameters
- $sLabel : string
-
The label
Tags
Return values
mixed —setOpenKey()
Overwrites the OpenKey for this area
public
setOpenKey(string $sOpenKey) : void
Parameters
- $sOpenKey : string
-
a maximum 32 Byte Unique Key
Tags
Return values
void —setOwnerID()
Sets the OwnerID on an area.
public
setOwnerID(int $iOwnerID) : void
Parameters
- $iOwnerID : int
-
The new OwnerID (User ID)
Tags
Return values
void —setResponseItems()
Add the OpenSearchItems to the Response
public
setResponseItems(CSOpenSearchRequest $oRequest, CSOpenSearchResponse $oResponse) : void
Parameters
- $oRequest : CSOpenSearchRequest
- $oResponse : CSOpenSearchResponse
Tags
Return values
void —setRunAsUserId()
Sets the UserAvatarID (RunAsUserId) attribute.
public
setRunAsUserId(int $iRunAsUserId) : mixed
Parameters
- $iRunAsUserId : int
-
UserAvatarID value
Tags
Return values
mixed —setSearchAreaPlugin()
Sets the search area plugin
public
setSearchAreaPlugin(mixed $oPlugin) : mixed
Parameters
- $oPlugin : mixed
Tags
Return values
mixed —setSearchAreaPluginName()
Sets the plugin associated with this area
public
setSearchAreaPluginName(string $sPluginClassName) : void
Parameters
- $sPluginClassName : string
-
The name of the plugin like "ProductOpenSearchArea"
Tags
Return values
void —setSearchSuggestion()
Sets the value for the SearchSuggestion.
public
setSearchSuggestion(bool $bShouldUseSearchSuggestion) : void
Parameters
- $bShouldUseSearchSuggestion : bool
-
To enabled or disable the property.
Tags
Return values
void —setSelectModeResponseItems()
Add the CSOpenSearchItem object to the Response for activated SelectMode
public
setSelectModeResponseItems(CSOpenSearchRequest $oRequest, CSOpenSearchResponse $oResponse) : void
Parameters
- $oRequest : CSOpenSearchRequest
- $oResponse : CSOpenSearchResponse
Tags
Return values
void —setSortOrder()
Sets ths sort order of an search area
public
setSortOrder(int $iSortOrder) : void
Parameters
- $iSortOrder : int
-
SQL Syntax sort order
Tags
Return values
void —setSortOrders()
Calls setSortOrders method of OpenSearchAreaMapping class
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.
setTabVisibility()
Sets the given value for ShowAsTab property of the current search area.
public
setTabVisibility(bool $bTabVisibility) : mixed
Parameters
- $bTabVisibility : bool
-
Value of ShowAsTab property of the current search area.
Tags
Return values
mixed —setUserAccess()
Set the UserAccess attribute.
public
setUserAccess(int $iUserAccess) : void
Parameters
- $iUserAccess : int
-
UserAccess value
Tags
Return values
void —setValue()
Generic setter method used by the explicit setter methods to set values in the database record of this area
public
setValue(string $sName, string $sValue) : void
Parameters
- $sName : string
-
The name
- $sValue : string
-
The value
Tags
Return values
void —setViewType()
Sets the View Type
public
setViewType([int $iViewType = self::VIEW_TYPE_ALWAYS ]) : mixed
Parameters
- $iViewType : int = self::VIEW_TYPE_ALWAYS
-
one of the CSOpenSearchArea::VIEW_TYPE_* constants
Tags
Return values
mixed —shouldUseSearchSuggestion()
Defines if the open search area should use search suggestions.
public
shouldUseSearchSuggestion(bool $bShouldUseSearchSuggestion) : void
Parameters
- $bShouldUseSearchSuggestion : bool
-
if the open search area should use search suggestions.
Tags
Return values
void —store()
Stores the underlying record to the database
public
store() : void
Tags
Return values
void —usesSearchSuggestion()
Returns whether the open search area uses search suggestions.
public
usesSearchSuggestion() : bool
Tags
Return values
bool —whether the open search area uses search suggestions.
