original_string: public function delete(array $data = array())
      {
          $sql = 'DELETE FROM log';
  
          $conditions = array();
  
          if (empty($data['log_id'])) {
              $sql .= " WHERE log_id IS NOT NULL";
          } else {
              settype($data['log_id'], 'array');
              $placeholders = rtrim(str_repeat('?,', count($data['log_id'])), ',');
              $sql .= " WHERE log_id IN($placeholders)";
              $conditions = array_merge($conditions, $data['log_id']);
          }
  
          if (!empty($data['type'])) {
              settype($data['type'], 'array');
              $placeholders = rtrim(str_repeat('?,', count($data['type'])), ',');
              $sql .= " AND type IN($placeholders)";
              $conditions = array_merge($conditions, $data['type']);
          }
  
          $this->db->run($sql, $conditions);
          return true;
      }
code: public function delete(array $data = array())
      {
          $sql = 'DELETE FROM log';
  
          $conditions = array();
  
          if (empty($data['log_id'])) {
              $sql .= " WHERE log_id IS NOT NULL";
          } else {
              settype($data['log_id'], 'array');
              $placeholders = rtrim(str_repeat('?,', count($data['log_id'])), ',');
              $sql .= " WHERE log_id IN($placeholders)";
              $conditions = array_merge($conditions, $data['log_id']);
          }
  
          if (!empty($data['type'])) {
              settype($data['type'], 'array');
              $placeholders = rtrim(str_repeat('?,', count($data['type'])), ',');
              $sql .= " AND type IN($placeholders)";
              $conditions = array_merge($conditions, $data['type']);
          }
  
          $this->db->run($sql, $conditions);
          return true;
      }
code_tokens: public function delete ( array $ data = array ( ) ) { $ sql = 'DELETE FROM log' ; $ conditions = array ( ) ; if ( empty ( $ data [ 'log_id' ] ) ) { $ sql .= " WHERE log_id IS NOT NULL" ; } else { settype ( $ data [ 'log_id' ] , 'array' ) ; $ placeholders = rtrim ( str_repeat ( '?,' , count ( $ data [ 'log_id' ] ) ) , ',' ) ; $ sql .= " WHERE log_id IN($placeholders)" ; $ conditions = array_merge ( $ conditions , $ data [ 'log_id' ] ) ; } if ( ! empty ( $ data [ 'type' ] ) ) { settype ( $ data [ 'type' ] , 'array' ) ; $ placeholders = rtrim ( str_repeat ( '?,' , count ( $ data [ 'type' ] ) ) , ',' ) ; $ sql .= " AND type IN($placeholders)" ; $ conditions = array_merge ( $ conditions , $ data [ 'type' ] ) ; } $ this -> db -> run ( $ sql , $ conditions ) ; return true ; }
docstring: Delete log records
  @param array $data
  @return boolean
docstring_tokens: Delete log records