Contentserv PHP API

CSMemoryDatabaseInstance
in package

Defines the instance class for the memory database interface.

The class creates an instance API object, which redirects the calls to the corresponding service depending on the given configuration.

Tags
since

CS23.5

Table of Contents

__construct()  : mixed
Defines the constructor of the memory database instance with the required configuration API object.
deleteItem()  : bool
Deletes a memory database item for a given key.
getConfiguration()  : CSMemoryDatabaseConfiguration
Returns the given & stored configuration of the memory database instance.
getItem()  : CSMemoryDatabaseItem
Returns the memory database item for the given key.
getMode()  : int
Returns the current mode of the instance.
getServiceInfo()  : CSMemoryDatabaseServiceInfo
getServiceType()  : int
Returns the stored service type of the memory database instance.
getSessionHandler()  : CSMemoryDatabaseSessionHandler|null
Returns a session handler API object if the service provides a separate session handling.
invalidate()  : bool
Invalidate memory database items for specific given tag names.
isConnected()  : bool
Checks if the service is connected.
isEnabled()  : bool
Checks if the instance is enabled.
isMode()  : bool
Checks if the given mode is active in the memory database instance.
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 final 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 instance.

public final getMode() : int

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

Tags
Return values
int

getServiceType()

Returns the stored service type of the memory database instance.

public final getServiceType() : int
Tags
Return values
int

invalidate()

Invalidate memory database items for specific given tag names.

public final 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 final isConnected() : bool
Tags
Return values
bool

isEnabled()

Checks if the instance is enabled.

public final isEnabled() : bool
Tags
Return values
bool

isMode()

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

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 final 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