original_string: protected function insert_event_entries($evententries) {
          if (!$this->init()) {
              return;
          }
          if (!$dbtable = $this->get_config('dbtable')) {
              return;
          }
          try {
              $this->extdb->insert_records($dbtable, $evententries);
          } catch (\moodle_exception $e) {
              debugging('Cannot write to external database: ' . $e->getMessage(), DEBUG_DEVELOPER);
          }
      }
code: protected function insert_event_entries($evententries) {
          if (!$this->init()) {
              return;
          }
          if (!$dbtable = $this->get_config('dbtable')) {
              return;
          }
          try {
              $this->extdb->insert_records($dbtable, $evententries);
          } catch (\moodle_exception $e) {
              debugging('Cannot write to external database: ' . $e->getMessage(), DEBUG_DEVELOPER);
          }
      }
code_tokens: protected function insert_event_entries ( $ evententries ) { if ( ! $ this -> init ( ) ) { return ; } if ( ! $ dbtable = $ this -> get_config ( 'dbtable' ) ) { return ; } try { $ this -> extdb -> insert_records ( $ dbtable , $ evententries ) ; } catch ( \ moodle_exception $ e ) { debugging ( 'Cannot write to external database: ' . $ e -> getMessage ( ) , DEBUG_DEVELOPER ) ; } }
docstring: Insert events in bulk to the database.
  
  @param array $evententries raw event data
docstring_tokens: Insert events in bulk to the database .