-
-
Save fago/a971e9af8d34e8343874 to your computer and use it in GitHub Desktop.
Mapping required and provided context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $rule = $this->expressionManager->createRule(); | |
| // The condition provides a "provided_text" variable. | |
| $rule->addCondition('rules_test_provider'); | |
| // The action provides a "concatenated" variable. | |
| $rule->addAction('rules_test_string', [ | |
| 'context_mapping' => ['text:select' => 'provided_text'], | |
| ]); | |
| // Add the same action again which will provide a "concatenated2" variable | |
| // now. | |
| $rule->addAction('rules_test_string', [ | |
| 'context_mapping' => ['text:select' => 'concatenated'], | |
| 'provides_mapping' => ['concatenated' => 'concatenated2'], | |
| ]); | |
| $rule->execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment