eZpedia : The Free eZ Publish CMS Documentation Encyclopedia

Snippet: PHP Snippet Adding subtree notification rules

This is compatible with eZ Publish 4.

This is a Stub article. Help the eZ Publish community by expanding it!

Code sample

The defined variables are:

  • $nodeID: id of the node for which we want to add a subtree notification rule
  • $userID: id of the user for which we want to add the notification rule
 
$nodeIDList = eZSubtreeNotificationRule::fetchNodesForUserID( $userID, false );
 
if ( !in_array( $nodeID, $nodeIDList ) )
{
    $rule =& eZSubtreeNotificationRule::create( $nodeID, $userID );
    $rule->store();
}

Article provided by eZpedia

All text is available under the terms of the GNU Free Documentation License

Powered by eZ Publish Community Project 4.2011

Hosted by Swiss eZ Publish partner YMC