/** * Execute 1 task manage by the plugin * * @param CronTask $task Object of CronTask class for log / stat * * @return interger * >0 : done * <0 : to be run again (not finished) * 0 : nothing to do */ static function cronSendNotifications($task) { global $LANG; $task->log($LANG['plugin_mreporting']['notification_log']); $entity = new Entity(); $found_entities = $entity->find(); foreach ($found_entities as $entity_data) { $params = $task->fields + array('entities_id' => $entity_data['id']); NotificationEvent::raiseEvent('sendReporting', new self(), $params); } return 1; }