original_string: protected function set_customdata($customdata) {
          // Always include the courseid (because is not stored in the notifications or messages table).
          if (!empty($this->courseid) && (is_object($customdata) || is_array($customdata))) {
              $customdata = (array) $customdata;
              $customdata['courseid'] = $this->courseid;
          }
          $this->customdata = json_encode($customdata);
      }
code: protected function set_customdata($customdata) {
          // Always include the courseid (because is not stored in the notifications or messages table).
          if (!empty($this->courseid) && (is_object($customdata) || is_array($customdata))) {
              $customdata = (array) $customdata;
              $customdata['courseid'] = $this->courseid;
          }
          $this->customdata = json_encode($customdata);
      }
code_tokens: protected function set_customdata ( $ customdata ) { // Always include the courseid (because is not stored in the notifications or messages table). if ( ! empty ( $ this -> courseid ) && ( is_object ( $ customdata ) || is_array ( $ customdata ) ) ) { $ customdata = ( array ) $ customdata ; $ customdata [ 'courseid' ] = $ this -> courseid ; } $ this -> customdata = json_encode ( $ customdata ) ; }
docstring: Always JSON encode customdata.
  
  @param mixed $customdata a data structure that must be serialisable using json_encode().
docstring_tokens: Always JSON encode customdata .