Merge branch '6' into 7

This commit is contained in:
github-actions 2024-03-20 12:36:51 +00:00
commit 5a15c904f0

View File

@ -37,11 +37,12 @@ class EmailRecipientCondition extends DataObject
'ValueLessThan' => 'Less than',
'ValueLessThanEqual' => 'Less than or equal',
'ValueGreaterThan' => 'Greater than',
'ValueGreaterThanEqual' => 'Greater than or equal'
'ValueGreaterThanEqual' => 'Greater than or equal',
'Includes' => 'Includes'
];
private static $db = [
'ConditionOption' => 'Enum("IsBlank,IsNotBlank,Equals,NotEquals,ValueLessThan,ValueLessThanEqual,ValueGreaterThan,ValueGreaterThanEqual")',
'ConditionOption' => 'Enum("IsBlank,IsNotBlank,Equals,NotEquals,ValueLessThan,ValueLessThanEqual,ValueGreaterThan,ValueGreaterThanEqual,Includes")',
'ConditionValue' => 'Varchar'
];
@ -96,6 +97,11 @@ class EmailRecipientCondition extends DataObject
$result = !($result);
}
break;
case 'Includes':
$result = is_array($fieldValue)
? in_array($conditionValue, $fieldValue)
: stripos($fieldValue ?? '', $conditionValue) !== false;
break;
default:
throw new LogicException("Unhandled rule {$this->ConditionOption}");
break;