Contentserv PHP API

CSOpenSearchItem
in package

Implements something that was found by a search area for a given search request

Tags
since

CS14.0

access

public

Table of Contents

__construct()  : mixed
Constructor
__toString()  : string
Returns the string representation of this object
addAdditionalItemInfo()  : mixed
This method adds info into the existing info collection.
addDisabledLink()  : CSOpenSearchLinkComponent
Add a disabled link for the datasheet when the preset is not defined
addDownloadLink()  : CSOpenSearchLinkComponent
The link is to be added in case of downloading a particular file directly
addInfo()  : void
Adds one info block
addLink()  : CSOpenSearchLinkComponent
Each Search Item can optionally be assigned one or multiple links Links are displayed at the end of a search result
addLinkComponent()  : CSOpenSearchLinkComponent
Each Search Item can optionally be assigned one or multiple links Links are displayed at the end of a search result
addThumb()  : void
Each Search Item can optionally have one or more thumbs additionally to the preview
getAdditionalItemInfo()  : array<string|int, mixed>
This method is used get additional info for the item.
getArea()  : string
Each Search Item can optionally be assigned a area Areas are displayed automatically as vertical filters in the search gui
getAuthor()  : string
Each search item can have an author name that is assigned here The author will be added to output results
getCategory()  : string
Each Search Item can optionally be assigned a category
getContentSize()  : string
Each Search Item can optionally be assigned a file content This will result in a download and maybe preview link
getContentType()  : string
Each Search Item can optionally be assigned a file as content This method returns the content type
getContentUrl()  : string
Each Search Item can optionally be assigned a link as content
getCssClass()  : string
Each search item can have a CSS class that is assigned here The CSS class will be added to output results
getDate()  : string
Each Search Item can optionally be assigned a date string
getDescription()  : string
Returns the description of the item
getIcon()  : string
Each search item can have an icon
getID()  : int
Returns the ID of the search item
getInfos()  : array<string|int, string>
Retrieves all Info Blocks
getIsMasterItem()  : bool
returns the item is master item or not
getIsReferencesAvailable()  : bool
returns the reference list status.
getIsReferencesAvailableInArea()  : bool
returns the status of existence of reference item in current search area.
getItemType()  : string
Retrieves the class name
getLabel()  : string
Returns the label of the search item
getLinkContents()  : array<string|int, mixed>
Returns the link contents assigned to the search item.
getLinks()  : array<string|int, CSOpenSearchLinkComponent>
Returns the links assigned to the search item.
getMaxPreviewsForList()  : int
Returns the maximal number of previews available for a list.
getPlaceholders()  : array<string|int, mixed>
Returns the placeholders assigned to the search item.
getPreviewUrl()  : string
Each Search Item can optionally be assigned a preview link
getReferencedByCount()  : mixed
Gets the number of times current item is Referenced by other items.
getSearchAreaID()  : int
Returns the search area id that added the search item
getSortOrder()  : int
Gets the sort order of item.
getThumbs()  : array<string|int, string>
Returns the thumbs assigned to the search item
getThumbUrl()  : string
Each Search Item can optionally have a thumb additionally to the preview
getTitle()  : string
Returns the title of the search item
getUrl()  : string
Returns the URL that should be opened onClick
removeLink()  : string
Removes a link from a search item
removeLinks()  : void
Removes all links from a search item
resetMaxPreviewsForList()  : void
Resets a maximal number of previews to a default value.
setAdditionalItemInfo()  : void
This method set the additional info for the item
setArea()  : void
Each Search Item can optionally be assigned a area Areas are displayed automatically as vertical filters in the search gui
setAuthor()  : void
Each search item can have an author name that is assigned here The author will be added to output results
setCategory()  : void
Each Search Item can optionally be assigned a category
setContent()  : null|CSMamFile
Each Search Item can optionally be assigned a MAM File as content This will result in a download and maybe preview link
setContentSize()  : void
Each Search Item can optionally be assigned a file content This will result in a download and maybe preview link
setContentType()  : void
Each Search Item can optionally be assigned a link as content This method returns the content type
setContentUrl()  : void
Each Search Item can optionally be assigned a link as content This will result in a download link
setCssClass()  : void
Each search item can have a CSS class that is assigned here The CSS class will be added to output results
setDate()  : void
Each Search Item can optionally be assigned a date string
setDescription()  : void
Overwrites the description set with the constructor
setIcon()  : void
Each search item can have an icon
setID()  : void
Overwrites the ID set with the constructor
setInfos()  : void
Sets all infos in one block
setIsMasterItem()  : mixed
Sets the item is master item or not
setIsReferencesAvailable()  : mixed
Sets reference list item availability for the search item
setIsReferencesAvailableInArea()  : void
Sets reference list item availability in current search area
setItemType()  : void
Sets the class of the item searched
setLabel()  : void
Set the label of item
setMaxPreviewsForList()  : void
Sets a maximal number of previews available for a list view.
setPlaceholders()  : void
Sets all placeholders to the search item in one block.
setPreviewUrl()  : void
Each Search Item can optionally be assigned a preview link This will result in a preview within the search results
setReferencedByCount()  : mixed
Sets the number of times current item is Referenced.
setSearchAreaID()  : void
Overwrites the searchAreaID name set with the constructor
setSortOrder()  : void
Sets the sort order of item.
setThumbUrl()  : void
Each Search Item can optionally have a thumb additionally to the preview
setTitle()  : void
Overwrites the title set with the constructor
setUrl()  : void
Overwrites the url set with the constructor

Methods

__construct()

Constructor

public __construct(string $searchAreaID, string $ID, string $title[, string $description = '' ][, bool $url = false ][, bool $thumbUrl = false ][, bool $area = false ][, string|null $sItemClass = null ]) : mixed
Parameters
$searchAreaID : string

The id of the search area

$ID : string

The ID

$title : string

The title of the found item

$description : string = ''

The description of the found item

$url : bool = false

The URL that should be opened onClick

$thumbUrl : bool = false

The url to a thumb for that item

$area : bool = false

The CSOpenSearchArea

$sItemClass : string|null = null

The Record class name like (Pdmarticle) of the given ID.

Tags
access

public

Return values
mixed

__toString()

Returns the string representation of this object

public __toString() : string
Tags
access

public

Return values
string

representation

addAdditionalItemInfo()

This method adds info into the existing info collection.

public addAdditionalItemInfo(mixed $mItemInfoKey, mixed $mItemInfo) : mixed
Parameters
$mItemInfoKey : mixed

String key of additional info.

$mItemInfo : mixed

Mixed value for the key

Tags
Return values
mixed

Add a disabled link for the datasheet when the preset is not defined

public addDisabledLink(string $sName[, string $sIcon = '' ][, string $sTooltipMessage = '' ]) : CSOpenSearchLinkComponent
Parameters
$sName : string

The identifier of the link.

$sIcon : string = ''

The icon name or path of the link.

$sTooltipMessage : string = ''

The icon name or path of the link.

Tags
access

public

Return values
CSOpenSearchLinkComponent

The link is to be added in case of downloading a particular file directly

public addDownloadLink(string $sName, string $mUrls, string $sDownloadFilePrefix) : CSOpenSearchLinkComponent
Parameters
$sName : string

The identifier of the link.

$mUrls : string

The url or an array of urls of the file(s) to be downloaded onClick of the link.

$sDownloadFilePrefix : string

The download prefix for the file

Tags
access

public

Return values
CSOpenSearchLinkComponent

addInfo()

Adds one info block

public addInfo(mixed $key, mixed $val) : void
Parameters
$key : mixed
$val : mixed
Tags
access

public

Return values
void

Each Search Item can optionally be assigned one or multiple links Links are displayed at the end of a search result

public addLink(string $sName, string $sUrl[, string $sIcon = '' ]) : CSOpenSearchLinkComponent
Parameters
$sName : string

The identifier of the link.

$sUrl : string

The url to open onClick of the link.

$sIcon : string = ''

The icon name or path of the link.

Tags
access

public

Return values
CSOpenSearchLinkComponent

addLinkComponent()

Each Search Item can optionally be assigned one or multiple links Links are displayed at the end of a search result

public addLinkComponent(string $sName, string $sHtml[, string $sIcon = '' ]) : CSOpenSearchLinkComponent
Parameters
$sName : string

The identifier of the link.

$sHtml : string

The url to open onClick of the link.

$sIcon : string = ''

The icon name or path of the link.

Tags
access

public

Return values
CSOpenSearchLinkComponent

addThumb()

Each Search Item can optionally have one or more thumbs additionally to the preview

public addThumb(string $url) : void
Parameters
$url : string

the url to the thumb

Tags
access

public

Return values
void

getAdditionalItemInfo()

This method is used get additional info for the item.

public getAdditionalItemInfo() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>

getArea()

Each Search Item can optionally be assigned a area Areas are displayed automatically as vertical filters in the search gui

public getArea() : string
Tags
access

public

Return values
string

the displayed area string in the search results

getAuthor()

Each search item can have an author name that is assigned here The author will be added to output results

public getAuthor() : string
Tags
access

public

Return values
string

the author to be used for this item

getCategory()

Each Search Item can optionally be assigned a category

public getCategory() : string
Tags
access

public

Return values
string

the displayed category in the search results

getContentSize()

Each Search Item can optionally be assigned a file content This will result in a download and maybe preview link

public getContentSize() : string
Tags
access

public

Return values
string

the displayed content size of the content file

getContentType()

Each Search Item can optionally be assigned a file as content This method returns the content type

public getContentType() : string
Tags
access

public

Return values
string

the content type

getContentUrl()

Each Search Item can optionally be assigned a link as content

public getContentUrl() : string
Tags
access

public

Return values
string

the URL

getCssClass()

Each search item can have a CSS class that is assigned here The CSS class will be added to output results

public getCssClass() : string
Tags
access

public

Return values
string

the CSS class assigned to this item

getDate()

Each Search Item can optionally be assigned a date string

public getDate() : string
Tags
access

public

Return values
string

the displayed date string in the search results

getDescription()

Returns the description of the item

public getDescription([int $chars = 200 ]) : string
Parameters
$chars : int = 200

The maximum length the description may have

Tags
access

public

Return values
string

The description that should be displayed next to the search item

getIcon()

Each search item can have an icon

public getIcon() : string
Tags
access

public

Return values
string

the URL to the icon

getID()

Returns the ID of the search item

public getID() : int
Tags
access

public

Return values
int

the ID

getInfos()

Retrieves all Info Blocks

public getInfos() : array<string|int, string>
Tags
access

public

Return values
array<string|int, string>

Array of Key => Val Info Blocks

getIsMasterItem()

returns the item is master item or not

public getIsMasterItem() : bool
Tags
@method

getIsMasterItem

access

public

Return values
bool

true if master item else false.

getIsReferencesAvailable()

returns the reference list status.

public getIsReferencesAvailable() : bool
Tags
Return values
bool

true if reference list item available otherwise false.

getIsReferencesAvailableInArea()

returns the status of existence of reference item in current search area.

public getIsReferencesAvailableInArea() : bool
Tags
@method

getIsReferencesAvailableInArea

access

public

Return values
bool

true if reference list item available in the current search area list else false.

getItemType()

Retrieves the class name

public getItemType() : string
Tags
access

public

Return values
string

The class name of the search result

getLabel()

Returns the label of the search item

public getLabel() : string
Tags
access

public

Return values
string

the label

getLinkContents()

Returns the link contents assigned to the search item.

public getLinkContents() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

the links as array with the name as key and the url as value

getMaxPreviewsForList()

Returns the maximal number of previews available for a list.

public getMaxPreviewsForList() : int
Tags
Return values
int

getPlaceholders()

Returns the placeholders assigned to the search item.

public getPlaceholders() : array<string|int, mixed>
Tags
access

public

Return values
array<string|int, mixed>

array with the information/properties of the placeholders.

getPreviewUrl()

Each Search Item can optionally be assigned a preview link

public getPreviewUrl() : string
Tags
access

public

Return values
string

the url to the preview

getReferencedByCount()

Gets the number of times current item is Referenced by other items.

public getReferencedByCount() : mixed
Tags
@method

getReferencedByCount

access

public

Return values
mixed

getSearchAreaID()

Returns the search area id that added the search item

public getSearchAreaID() : int
Tags
access

public

Return values
int

the id of the search area

getSortOrder()

Gets the sort order of item.

public getSortOrder() : int
Tags
@method

getSortOrder

Return values
int

Sort order of item.

getThumbs()

Returns the thumbs assigned to the search item

public getThumbs() : array<string|int, string>
Tags
access

public

Return values
array<string|int, string>

array with the thumbs as URLs

getThumbUrl()

Each Search Item can optionally have a thumb additionally to the preview

public getThumbUrl() : string
Tags
access

public

Return values
string

the url to the thumb

getTitle()

Returns the title of the search item

public getTitle() : string
Tags
access

public

Return values
string

the title

getUrl()

Returns the URL that should be opened onClick

public getUrl() : string
Tags
access

public

Return values
string

the url that should be opened onClick

Removes a link from a search item

public removeLink(string $name) : string
Parameters
$name : string

the name under which the link was added

Tags
access

public

Return values
string

the link url that was removed

Removes all links from a search item

public removeLinks() : void
Tags
access

public

Return values
void

resetMaxPreviewsForList()

Resets a maximal number of previews to a default value.

public resetMaxPreviewsForList() : void
Tags
Return values
void

setAdditionalItemInfo()

This method set the additional info for the item

public setAdditionalItemInfo(mixed $additionalInfo) : void
Parameters
$additionalInfo : mixed

is the array which used as additional info.

Tags
Return values
void

setArea()

Each Search Item can optionally be assigned a area Areas are displayed automatically as vertical filters in the search gui

public setArea(string $area) : void
Parameters
$area : string

the displayed area string in the search results

Tags
access

public

Return values
void

setAuthor()

Each search item can have an author name that is assigned here The author will be added to output results

public setAuthor(string $author) : void
Parameters
$author : string

the author to be used for this item

Tags
access

public

Return values
void

setCategory()

Each Search Item can optionally be assigned a category

public setCategory(string $category) : void
Parameters
$category : string

the displayed category in the search results

Tags
access

public

Return values
void

setContent()

Each Search Item can optionally be assigned a MAM File as content This will result in a download and maybe preview link

public setContent(int $mamFileID) : null|CSMamFile
Parameters
$mamFileID : int

the ID of the content file

Tags
access

public

Return values
null|CSMamFile

Returns null if not valid Mamfile ID is given or an CSMamFile object

setContentSize()

Each Search Item can optionally be assigned a file content This will result in a download and maybe preview link

public setContentSize(string $size) : void
Parameters
$size : string

the displayed content size of the content file

Tags
access

public

Return values
void

setContentType()

Each Search Item can optionally be assigned a link as content This method returns the content type

public setContentType(string $contentType) : void
Parameters
$contentType : string

the content type like text/html

Tags
access

public

Return values
void

setContentUrl()

Each Search Item can optionally be assigned a link as content This will result in a download link

public setContentUrl(mixed $contentUrl) : void
Parameters
$contentUrl : mixed
Tags
access

public

Return values
void

setCssClass()

Each search item can have a CSS class that is assigned here The CSS class will be added to output results

public setCssClass(string $cssClass) : void
Parameters
$cssClass : string

the CSS class to be used for this item

Tags
access

public

Return values
void

setDate()

Each Search Item can optionally be assigned a date string

public setDate(string $date) : void
Parameters
$date : string

the displayed date string in the search results

Tags
access

public

Return values
void

setDescription()

Overwrites the description set with the constructor

public setDescription(string $description) : void
Parameters
$description : string

the description that should be displayed next to the search item

Tags
access

public

Return values
void

setIcon()

Each search item can have an icon

public setIcon(string $icon) : void
Parameters
$icon : string

url the icon

Tags
access

public

Return values
void

setID()

Overwrites the ID set with the constructor

public setID(int $ID) : void
Parameters
$ID : int

ID of the search item

Tags
access

public

Return values
void

setInfos()

Sets all infos in one block

public setInfos(array<string|int, string> $infos) : void
Parameters
$infos : array<string|int, string>

with key and vals

Tags
access

public

Return values
void

setIsMasterItem()

Sets the item is master item or not

public setIsMasterItem(bool $bisMaster) : mixed
Parameters
$bisMaster : bool

true if master item else false.

Tags
@method

setIsMasterItem

access

public

Return values
mixed

setIsReferencesAvailable()

Sets reference list item availability for the search item

public setIsReferencesAvailable(bool $bAvailable) : mixed
Parameters
$bAvailable : bool

true if reference list available otherwise false.

Tags
Return values
mixed

setIsReferencesAvailableInArea()

Sets reference list item availability in current search area

public setIsReferencesAvailableInArea(bool $bAvailable) : void
Parameters
$bAvailable : bool

true if reference list item available otherwise false.

Tags
@method

setIsReferencesAvailableInArea

access

public

Return values
void

setItemType()

Sets the class of the item searched

public setItemType(string $sClassName) : void
Parameters
$sClassName : string

The item class, like "Pdmarticle"

Tags
access

public

Return values
void

setLabel()

Set the label of item

public setLabel(string $label) : void
Parameters
$label : string

label of the search item

Tags
access

public

Return values
void

setMaxPreviewsForList()

Sets a maximal number of previews available for a list view.

public setMaxPreviewsForList(int $iNumber) : void
Parameters
$iNumber : int
Tags
Return values
void

setPlaceholders()

Sets all placeholders to the search item in one block.

public setPlaceholders(array<string|int, mixed> $aPlaceholders) : void
Parameters
$aPlaceholders : array<string|int, mixed>

The array that contain the information/properties of the new placeholders. The array key is the name of the placeholder and the array value is the additional properties/information for the respective placeholder.

Tags
access

public

Return values
void

setPreviewUrl()

Each Search Item can optionally be assigned a preview link This will result in a preview within the search results

public setPreviewUrl(string $previewUrl) : void
Parameters
$previewUrl : string

the URL to the preview image, recommended is a thumb of 256px x 256px

Tags
access

public

Return values
void

setReferencedByCount()

Sets the number of times current item is Referenced.

public setReferencedByCount(int $iCount) : mixed
Parameters
$iCount : int

It is the number to set for count.

Tags
@method

setReferencedByCount

access

public

Return values
mixed

setSearchAreaID()

Overwrites the searchAreaID name set with the constructor

public setSearchAreaID(int $searchAreaID) : void
Parameters
$searchAreaID : int

id of the area that added this item

Tags
access

public

Return values
void

setSortOrder()

Sets the sort order of item.

public setSortOrder(int $iSortOrder) : void
Parameters
$iSortOrder : int

It is the value of sort order.

Tags
@method

setSortOrder

Return values
void

setThumbUrl()

Each Search Item can optionally have a thumb additionally to the preview

public setThumbUrl(string $thumbUrl) : void
Parameters
$thumbUrl : string

the url to the thumb

Tags
access

public

Return values
void

setTitle()

Overwrites the title set with the constructor

public setTitle(string $title) : void
Parameters
$title : string

title of the search item

Tags
access

public

Return values
void

setUrl()

Overwrites the url set with the constructor

public setUrl(string $url) : void
Parameters
$url : string

the url that should be opened onClick

Tags
access

public

Return values
void

        

Search results