eZpedia : The Free eZ Publish CMS Documentation Encyclopedia

Snippet: PHP Snippet Adding collaboration notification rules

This is compatible with eZ Publish 4.

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

The following code sample shows you how to create a new collaboration notification rule for a specific user. The known variables are:

  • $collaborationIdentifier: identifier of the collaboration type, for example ezapprove
  • $userID: the content object id of the user we want to create the rule for
$existing = eZCollaborationNotificationRule::fetchItemTypeList( $collaborationIdentifier, array( $userID ) );
 
if ( count( $existing ) == 0 )
{
    $rule = eZCollaborationNotificationRule::create( $collaborationIdentifier, $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