original_string: public function process_computed_correlation(stdClass $tagcorrelation) {
          global $DB;
  
          // You must provide a tagid and correlatedtags must be set and be an array.
          if (empty($tagcorrelation->tagid) || !isset($tagcorrelation->correlatedtags) ||
                  !is_array($tagcorrelation->correlatedtags)) {
              return false;
          }
  
          $tagcorrelation->correlatedtags = join(',', $tagcorrelation->correlatedtags);
          if (!empty($tagcorrelation->id)) {
              // The tag correlation already exists so update it.
              $DB->update_record('tag_correlation', $tagcorrelation);
          } else {
              // This is a new correlation to insert.
              $tagcorrelation->id = $DB->insert_record('tag_correlation', $tagcorrelation);
          }
          return $tagcorrelation->id;
      }
code: public function process_computed_correlation(stdClass $tagcorrelation) {
          global $DB;
  
          // You must provide a tagid and correlatedtags must be set and be an array.
          if (empty($tagcorrelation->tagid) || !isset($tagcorrelation->correlatedtags) ||
                  !is_array($tagcorrelation->correlatedtags)) {
              return false;
          }
  
          $tagcorrelation->correlatedtags = join(',', $tagcorrelation->correlatedtags);
          if (!empty($tagcorrelation->id)) {
              // The tag correlation already exists so update it.
              $DB->update_record('tag_correlation', $tagcorrelation);
          } else {
              // This is a new correlation to insert.
              $tagcorrelation->id = $DB->insert_record('tag_correlation', $tagcorrelation);
          }
          return $tagcorrelation->id;
      }
code_tokens: public function process_computed_correlation ( stdClass $ tagcorrelation ) { global $ DB ; // You must provide a tagid and correlatedtags must be set and be an array. if ( empty ( $ tagcorrelation -> tagid ) || ! isset ( $ tagcorrelation -> correlatedtags ) || ! is_array ( $ tagcorrelation -> correlatedtags ) ) { return false ; } $ tagcorrelation -> correlatedtags = join ( ',' , $ tagcorrelation -> correlatedtags ) ; if ( ! empty ( $ tagcorrelation -> id ) ) { // The tag correlation already exists so update it. $ DB -> update_record ( 'tag_correlation' , $ tagcorrelation ) ; } else { // This is a new correlation to insert. $ tagcorrelation -> id = $ DB -> insert_record ( 'tag_correlation' , $ tagcorrelation ) ; } return $ tagcorrelation -> id ; }
docstring: This function processes a tag correlation and makes changes in the database as required.
  
  The tag correlation object needs have both a tagid property and a correlatedtags property that is an array.
  
  @param   stdClass $tagcorrelation
  @return  int/bool The id of the tag correlation that was just processed or false.
docstring_tokens: This function processes a tag correlation and makes changes in the database as required .