original_string: public function add(array $data)
      {
          if (!$this->isDb()) {
              return false;
          }
  
          $data += array(
              'created' => GC_TIME,
              'log_id' => gplcart_string_random(6)
          );
  
          try {
              $result = (bool) $this->db->insert('log', $data);
          } catch (Exception $ex) {
              $result = false;
          }
  
          return $result;
      }
code: public function add(array $data)
      {
          if (!$this->isDb()) {
              return false;
          }
  
          $data += array(
              'created' => GC_TIME,
              'log_id' => gplcart_string_random(6)
          );
  
          try {
              $result = (bool) $this->db->insert('log', $data);
          } catch (Exception $ex) {
              $result = false;
          }
  
          return $result;
      }
code_tokens: public function add ( array $ data ) { if ( ! $ this -> isDb ( ) ) { return false ; } $ data += array ( 'created' => GC_TIME , 'log_id' => gplcart_string_random ( 6 ) ) ; try { $ result = ( bool ) $ this -> db -> insert ( 'log' , $ data ) ; } catch ( Exception $ ex ) { $ result = false ; } return $ result ; }
docstring: Adds a log record
  @param array $data
  @return bool
docstring_tokens: Adds a log record