Created
February 24, 2010 10:42
-
-
Save fago/313323 to your computer and use it in GitHub Desktop.
reaction rule example
This file contains 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
$rule = rules_reaction_rule(); | |
$rule->event('node_insert'); | |
$rule->condition('data_is', array('data:select' => 'node:type', 'op' => 'IN', 'value' => array('product'))); | |
$rule->condition(rules_or() | |
->condition('data_is', array('data:select' => 'node:product:0:type', 'value' => 'shirt')) | |
->condition('data_is', array('data:select' => 'node:product:author:uid', 'value' => 1)) | |
); | |
$rule->action('data_set', array('data' => 'node:status', 'value' => 1)); | |
$rule->save(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment