original_string: public function fetch_data_key() {
          global $CFG, $DB;
  
          // Only generate a key if Inbound Message is actually enabled, and the handler is enabled.
          if (!isset($CFG->messageinbound_enabled) || !$this->handler || !$this->handler->enabled) {
              return null;
          }
  
          if (!isset($this->datakey)) {
              // Attempt to fetch an existing key first if one has not already been specified.
              $datakey = $DB->get_field('messageinbound_datakeys', 'datakey', array(
                      'handler' => $this->handler->id,
                      'datavalue' => $this->datavalue,
                  ));
              if (!$datakey) {
                  $datakey = $this->generate_data_key();
              }
              $this->datakey = $datakey;
          }
  
          return $this->datakey;
      }
code: public function fetch_data_key() {
          global $CFG, $DB;
  
          // Only generate a key if Inbound Message is actually enabled, and the handler is enabled.
          if (!isset($CFG->messageinbound_enabled) || !$this->handler || !$this->handler->enabled) {
              return null;
          }
  
          if (!isset($this->datakey)) {
              // Attempt to fetch an existing key first if one has not already been specified.
              $datakey = $DB->get_field('messageinbound_datakeys', 'datakey', array(
                      'handler' => $this->handler->id,
                      'datavalue' => $this->datavalue,
                  ));
              if (!$datakey) {
                  $datakey = $this->generate_data_key();
              }
              $this->datakey = $datakey;
          }
  
          return $this->datakey;
      }
code_tokens: public function fetch_data_key ( ) { global $ CFG , $ DB ; // Only generate a key if Inbound Message is actually enabled, and the handler is enabled. if ( ! isset ( $ CFG -> messageinbound_enabled ) || ! $ this -> handler || ! $ this -> handler -> enabled ) { return null ; } if ( ! isset ( $ this -> datakey ) ) { // Attempt to fetch an existing key first if one has not already been specified. $ datakey = $ DB -> get_field ( 'messageinbound_datakeys' , 'datakey' , array ( 'handler' => $ this -> handler -> id , 'datavalue' => $ this -> datavalue , ) ) ; if ( ! $ datakey ) { $ datakey = $ this -> generate_data_key ( ) ; } $ this -> datakey = $ datakey ; } return $ this -> datakey ; }
docstring: Return the data key for the data item.
  
  If no data key has been defined yet, this will call generate_data_key() to generate a new key on the fly.
  @return string The secret key for this data item.
docstring_tokens: Return the data key for the data item .