Contentserv PHP API

CSRuleApiCondition
in package

Tags

Table of Contents

STATUS_FULFILLED  = \CSRuleConst::STATUS_FULFILLED
Defines the fulfilled status constant
STATUS_NOT_FULFILLED  = \CSRuleConst::STATUS_NOT_FULFILLED
Defines the not fulfilled status constant
STATUS_WARNING  = \CSRuleConst::STATUS_WARNING
Defines the warning status constant
TYPE_CONDITION  = 0
Defines the available condition types.
TYPE_PRE_CONDITION  = 1
VISIBILITY_TYPE_ALL  = 3
VISIBILITY_TYPE_CONDITION  = 1
VISIBILITY_TYPE_NONE  = 0
Defines the constants for the available visibility types which can be used in the condition plugins.
VISIBILITY_TYPE_PRE_CONDITION  = 2
__construct()  : mixed
CSRuleApiCondition constructor.
getConditionResult()  : CSRuleApiConditionResult
Returns the condition API result of the condition execution.
getConditionStatus()  : int
Checks if the condition status is fulfilled, not fulfilled or warning.
getDescription()  : string
Returns the description of the condition API object.
getId()  : int|null
Returns the condition id.
getLabel()  : string
Returns the defined label of the condition API object.
getModifyFlag()  : int|null
Returns the modification flag of the condition API object.
getName()  : string
Returns the defined name of the condition API object.
getPlugin()  : CSRuleConditionPlugin
Returns the stored plugin of the current condition.
getPluginName()  : string
Returns the plugin name in lower case characters.
getRule()  : CSRuleApiRule
Returns the rule API object.
getRuleId()  : int|null
Returns the rule id.
getTargetRule()  : CSSystemRuleApiRule|CSDataQualityRuleApiRule|null
Returns the target rule from the condition if defined
getTargetRuleForRowData()  : string
Returns the formatted condition's target rule name and id for given data.
getType()  : int
Returns the condition type. Possible condition types: CSRuleApiCondition::TYPE_*
getValue()  : false|mixed
Returns a specific value for a given key.
getValues()  : array<string|int, mixed>
Returns all defined values in the condition API object.
isFulfilled()  : bool
Checks if the condition is fulfilled.
isPreCondition()  : bool
Returns if the condition API object is a pre condition.
isWarningCondition()  : bool
Returns the warning state.
removeValue()  : bool
Removes a defined value for a given key.
removeValues()  : void
Removes all defined values.
setDescription()  : void
Sets the description to the condition API object.
setIsWarningCondition()  : void
Sets the warning state of the condition API object, which should be used for the condition execution.
setLabel()  : void
Sets the label to the condition API object.
setModifyFlag()  : void
Sets the modification flag for the condition API object.
setName()  : void
Sets the unique name to the condition API object.
setPluginName()  : void
Sets the plugin name of the condition API object, which should be used for the condition execution.
setValue()  : void
Sets any key to the condition API object.
setValues()  : void
Sets multiple values with a key & value pair to the condition API object.

Constants

STATUS_FULFILLED

Defines the fulfilled status constant

public int STATUS_FULFILLED = \CSRuleConst::STATUS_FULFILLED
Tags
deprecated

The constant should not be used anymore. Please use the constant in the CSRuleApiConditionResult API object.

STATUS_NOT_FULFILLED

Defines the not fulfilled status constant

public int STATUS_NOT_FULFILLED = \CSRuleConst::STATUS_NOT_FULFILLED
Tags
deprecated

The constant should not be used anymore. Please use the constant in the CSRuleApiConditionResult API object.

STATUS_WARNING

Defines the warning status constant

public int STATUS_WARNING = \CSRuleConst::STATUS_WARNING
Tags
deprecated

The constants should not be used anymore. Please use the constant in the CSRuleApiConditionResult API object.

TYPE_CONDITION

Defines the available condition types.

public int TYPE_CONDITION = 0
Tags

VISIBILITY_TYPE_NONE

Defines the constants for the available visibility types which can be used in the condition plugins.

public int VISIBILITY_TYPE_NONE = 0
Tags

VISIBILITY_TYPE_PRE_CONDITION

public mixed VISIBILITY_TYPE_PRE_CONDITION = 2
Tags

Methods

__construct()

CSRuleApiCondition constructor.

public __construct([int|null $iConditionId = null ][, CSRuleApiRule|int|null $mRule = null ][, int $iType = self::TYPE_CONDITION ]) : mixed
Parameters
$iConditionId : int|null = null

The condition id.

$mRule : CSRuleApiRule|int|null = null

The rule API object or the rule id.

$iType : int = self::TYPE_CONDITION

The type of the condition. See available condition types: CSRuleApiCondition::TYPE_*

Tags
Return values
mixed

getConditionResult()

Returns the condition API result of the condition execution.

public getConditionResult(CSRuleContext $oContext[, int|null $iLanguageId = null ]) : CSRuleApiConditionResult

It contains the valid & attribute ids and the status of the condition execution.

Parameters
$oContext : CSRuleContext

The current rule context, which should be checked with the condition.

$iLanguageId : int|null = null

The language id, which should be used to check the condition.

Tags
Return values
CSRuleApiConditionResult

The condition API result with all necessary information.

getConditionStatus()

Checks if the condition status is fulfilled, not fulfilled or warning.

public getConditionStatus(CSRuleContext $oContext[, int|null $iLanguageId = null ]) : int
Parameters
$oContext : CSRuleContext

The current rule context, which should be checked with the condition.

$iLanguageId : int|null = null

The language id, which should be used to check the condition.

Tags
Return values
int

the rule status.

getDescription()

Returns the description of the condition API object.

public getDescription([int|null $iLanguageId = null ]) : string
Parameters
$iLanguageId : int|null = null

The requested language id for the label.

Tags
Return values
string

with the description of the condition API object.

getId()

Returns the condition id.

public getId() : int|null
Tags
Return values
int|null

with the condition id or null if it is a blank condition.

getLabel()

Returns the defined label of the condition API object.

public getLabel([int|null $iLanguageId = null ]) : string
Parameters
$iLanguageId : int|null = null

The requested language id for the label.

Tags
Return values
string

with the defined label of the condition API object.

getModifyFlag()

Returns the modification flag of the condition API object.

public getModifyFlag() : int|null
Tags
Return values
int|null

Returns null if no flag has been defined or returns the flag.

getName()

Returns the defined name of the condition API object.

public getName() : string
Tags
Return values
string

with the defined name of the condition API object.

getPluginName()

Returns the plugin name in lower case characters.

public getPluginName() : string
Tags
Return values
string

with the plugin name in lower case characters.

getRule()

Returns the rule API object.

public getRule() : CSRuleApiRule
Tags
Return values
CSRuleApiRule

getRuleId()

Returns the rule id.

public getRuleId() : int|null
Tags
Return values
int|null

with the rule id or null if it is a blank condition.

getTargetRule()

Returns the target rule from the condition if defined

public getTargetRule() : CSSystemRuleApiRule|CSDataQualityRuleApiRule|null
Tags
access

public

Return values
CSSystemRuleApiRule|CSDataQualityRuleApiRule|null

getTargetRuleForRowData()

Returns the formatted condition's target rule name and id for given data.

public static getTargetRuleForRowData(array<string|int, mixed> $aData) : string
Parameters
$aData : array<string|int, mixed>

The row data that was passed from the list.

Tags
Return values
string

getType()

Returns the condition type. Possible condition types: CSRuleApiCondition::TYPE_*

public getType() : int
Tags
Return values
int

with the condition type.

getValue()

Returns a specific value for a given key.

public getValue(mixed $mKey) : false|mixed
Parameters
$mKey : mixed

The key to get the value.

Tags
Return values
false|mixed

Returns false if the key does not exist or returns the requested value for the given key.

getValues()

Returns all defined values in the condition API object.

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

with all defined values in the condition API object.

isFulfilled()

Checks if the condition is fulfilled.

public isFulfilled(CSRuleContext $oContext[, int|null $iLanguageId = null ]) : bool
Parameters
$oContext : CSRuleContext

The current rule context, which should be checked with the condition.

$iLanguageId : int|null = null

The language id, which should be used to check the condition.

Tags
deprecated

Use

Return values
bool

if the condition is fulfilled.

isPreCondition()

Returns if the condition API object is a pre condition.

public isPreCondition() : bool
Tags
Return values
bool

if the condition API object is a pre condition.

isWarningCondition()

Returns the warning state.

public isWarningCondition() : bool
Tags
Return values
bool

if it is a warning

removeValue()

Removes a defined value for a given key.

public removeValue(mixed $mKey) : bool
Parameters
$mKey : mixed

The key, which should be removed from the values.

Tags
Return values
bool

If it returns false the key does not exist and it returns true if the value has been removed successfully.

removeValues()

Removes all defined values.

public removeValues() : void
Tags
Return values
void

setDescription()

Sets the description to the condition API object.

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

The description of the condition.

Tags
Return values
void

setIsWarningCondition()

Sets the warning state of the condition API object, which should be used for the condition execution.

public setIsWarningCondition(bool $bIsWarning) : void
Parameters
$bIsWarning : bool

if it is a warning

Tags
Return values
void

setLabel()

Sets the label to the condition API object.

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

The new label of the condition.

Tags
Return values
void

setModifyFlag()

Sets the modification flag for the condition API object.

public setModifyFlag(int $iModifyFlag) : void
Parameters
$iModifyFlag : int

The modification flag. Possible flags CSRuleApiRule::SUB_RECORD_MODIFY_FLAG_CHANGED

Tags
Return values
void

setName()

Sets the unique name to the condition API object.

public setName(string $sName) : void
Parameters
$sName : string

The new & unique name of the condition.

Tags
Return values
void

setPluginName()

Sets the plugin name of the condition API object, which should be used for the condition execution.

public setPluginName(string $sPluginName) : void
Parameters
$sPluginName : string

The plugin name, which should be used for the condition execution.

Tags
Return values
void

setValue()

Sets any key to the condition API object.

public setValue(mixed $mKey, mixed $mValue) : void
Parameters
$mKey : mixed

The key of the value.

$mValue : mixed

The value.

Tags
Return values
void

setValues()

Sets multiple values with a key & value pair to the condition API object.

public setValues(array<string|int, mixed> $aValues) : void
Parameters
$aValues : array<string|int, mixed>

The values with a key & value pair, which should be set to the condition API object.

Tags
Return values
void

        

Search results