Contentserv PHP API

_CSMemoryDatabaseService
in package

Defines the abstract class for the memory database services.

The class provides the base object with getter method to receive information for a specific service type.

Tags
since

CS23.5

Table of Contents

__construct()  : mixed
Defines the constructor of the memory database service.
deleteItem()  : bool
Deletes a memory database item for a given key.
getConfiguration()  : CSMemoryDatabaseConfiguration
Returns the given & stored configuration of the memory database service.
getItem()  : CSMemoryDatabaseItem
Returns the memory database item for the given key.
getMode()  : int
Returns the current mode of the service.
getResponseTime()  : float|null
Receives the current response time in micro seconds of the service.
getSessionHandler()  : CSMemoryDatabaseSessionHandler|null
Returns a session handler API object if the service provides a separate session handling.
getVersion()  : string
Receives version information from the service.
invalidate()  : bool
Invalidate memory database items for specific given tag names.
isConnected()  : bool
Checks if the service is connected.
isEnabled()  : bool
Checks if the service is enabled.
isMode()  : bool
Checks if the given mode is active in the memory database service.
prepareErrorMessage()  : void
Provides the possibility to modify / prepare error message specific for a service type.
setItem()  : bool
Sets & stores a given memory database item to the service storage.

Methods

deleteItem()

Deletes a memory database item for a given key.

public abstract deleteItem(string $sKey) : bool

If the item exists and could be deleted, the method will return true, otherwise false.

Parameters
$sKey : string

The target key of the item.

Tags
Return values
bool

getMode()

Returns the current mode of the service.

public abstract getMode() : int

Please use the constants "CSMemoryDatabaseConst::MODE_" as return values.

Tags
Return values
int

getResponseTime()

Receives the current response time in micro seconds of the service.

public abstract getResponseTime() : float|null

In case of an error the value "null" will be returned.

Tags
Return values
float|null

getVersion()

Receives version information from the service.

public abstract getVersion() : string
Tags
Return values
string

invalidate()

Invalidate memory database items for specific given tag names.

public abstract invalidate([array<string|int, mixed> $aTags = [] ]) : bool

It will delete all items, which have defined the given tags.

Parameters
$aTags : array<string|int, mixed> = []

An array with tag names that should be deleted.

Tags
Return values
bool

isConnected()

Checks if the service is connected.

public abstract isConnected() : bool
Tags
Return values
bool

isEnabled()

Checks if the service is enabled.

public abstract isEnabled() : bool
Tags
Return values
bool

isMode()

Checks if the given mode is active in the memory database service.

public final isMode(int $iMode) : bool
Parameters
$iMode : int

The mode, which should be checked. Please use the constants "CSMemoryDatabaseConst::MODE_"

Tags
Return values
bool

prepareErrorMessage()

Provides the possibility to modify / prepare error message specific for a service type.

public abstract prepareErrorMessage(string &$sMessage, int $iErrorType, bool &$bShowTrace) : void
Parameters
$sMessage : string

The original error message.

$iErrorType : int

The error type.

$bShowTrace : bool

Whether the trace should be shown for the corresponding error message.

Tags
Return values
void

        

Search results