function fetchHttpInput($http, $module) { if ($http->hasPostVariable('CollaborationHandlerSelection')) { $oldSelection = $this->collaborationSelections(); $selection = array(); if ($http->hasPostVariable('CollaborationHandlerSelection_' . self::NOTIFICATION_HANDLER_ID)) { $selection = $http->postVariable('CollaborationHandlerSelection_' . self::NOTIFICATION_HANDLER_ID); } $createRules = array_diff($selection, $oldSelection); $removeRules = array_diff($oldSelection, $selection); if (count($removeRules) > 0) { eZCollaborationNotificationRule::removeByIdentifier(array($removeRules)); } foreach ($createRules as $createRule) { $rule = eZCollaborationNotificationRule::create($createRule); $rule->store(); } } }