Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Protected Member Functions | Protected Attributes
Conditions Class Reference
Inheritance diagram for Conditions:
Curl Curl Curl

Protected Member Functions

 prepareCondition ($conditions)
 

Protected Attributes

 $mapTypeParams = []
 
 $mapRuleParams
 
 $encodeChars
 
 $decodeChars
 

Detailed Description

Class Conditions Curl class for fixture with conditions

Format value of conditions. Add slash to symbols: "{", "}", "[", "]", ":".

  1. Single condition: [Type|Param|Param|...|Param]
  2. List conditions: [Type|Param|Param|...|Param] [Type|Param|Param|...|Param] [Type|Param|Param|...|Param]
  3. Combination condition with single condition {Type|Param|Param|...|Param:[Type|Param|Param|...|Param]}
  4. Combination condition with list conditions {Type|Param|Param|...|Param:[[Type|Param|...|Param][Type|Param|...|Param]...[Type|Param|...|Param]]}

Example value: {Products subselection|total amount|greater than|135|ANY:[[Price in cart|is|100][Quantity in cart|is|100]]} {Conditions combination:[ [Subtotal|is|100] {Product attribute combination|NOT FOUND|ANY:[[Attribute Set|is|Default][Attribute Set|is|Default]]} ]}

Definition at line 35 of file Conditions.php.

Member Function Documentation

◆ prepareCondition()

prepareCondition (   $conditions)
protected

Prepare conditions to array for send by post request

Parameters
string$conditions
Returns
array

Definition at line 109 of file Conditions.php.

110  {
111  $decodeConditions = empty($conditions)
112  ? $this->decodeValue("[Conditions combination]")
113  : $this->decodeValue("{Conditions combination:[{$conditions}]}");
114  return $this->convertMultipleCondition($decodeConditions);
115  }

Field Documentation

◆ $decodeChars

$decodeChars
protected
Initial value:
= [
'{' => '{',
'}' => '}',
'&lbracket;' => '[',
'&rbracket;' => ']',
':' => ':',
]

Definition at line 95 of file Conditions.php.

◆ $encodeChars

$encodeChars
protected
Initial value:
= [
'\{' => '{',
'\}' => '}',
'\[' => '&lbracket;',
'\]' => '&rbracket;',
'\:' => ':',
]

Definition at line 82 of file Conditions.php.

◆ $mapRuleParams

$mapRuleParams
protected
Initial value:
= [
'operator' => [
'is' => '==',
'is not' => '!=',
'equal to' => '==',
'matches' => '==',
'greater than' => '>',
'equals or greater than' => '>=',
],
'value_type' => [
'same_as' => 'the Same as Matched Product Categories',
],
'value' => [
'California' => '12',
'United States' => 'US',
'[flatrate] Fixed' => 'flatrate_flatrate',
'FOUND' => '1',
'TRUE' => '1',
],
'aggregator' => [
'ALL' => 'all',
'ANY' => 'any',
],
'attribute'=> [
'total quantity' => 'qty',
],
]

Definition at line 49 of file Conditions.php.

◆ $mapTypeParams

$mapTypeParams = []
protected

Definition at line 42 of file Conditions.php.


The documentation for this class was generated from the following file: