original_string: public static function update_purpose(stdClass $record) {
          if (!isset($record->sensitivedatareasons)) {
              $record->sensitivedatareasons = '';
          }
  
          $purpose = new purpose($record->id);
          $purpose->from_record($record);
  
          $result = $purpose->update();
  
          return $purpose;
      }
code: public static function update_purpose(stdClass $record) {
          if (!isset($record->sensitivedatareasons)) {
              $record->sensitivedatareasons = '';
          }
  
          $purpose = new purpose($record->id);
          $purpose->from_record($record);
  
          $result = $purpose->update();
  
          return $purpose;
      }
code_tokens: public static function update_purpose ( stdClass $ record ) { if ( ! isset ( $ record -> sensitivedatareasons ) ) { $ record -> sensitivedatareasons = '' ; } $ purpose = new purpose ( $ record -> id ) ; $ purpose -> from_record ( $ record ) ; $ result = $ purpose -> update ( ) ; return $ purpose ; }
docstring: Updates an existing data purpose.
  
  @param stdClass $record
  @return \tool_dataprivacy\purpose.
docstring_tokens: Updates an existing data purpose .