original_string: function deleteWhere($table_name, $where_with_placeholders, $named_parameters) {
  
              if (empty($where_with_placeholders) || !$table_name) {
                  return false;
              }
  
              $sql_query = 'DELETE FROM ' . $table_name . ' WHERE ' . $where_with_placeholders;
  
              Event::dispatch(EventData::forBefore(Event::BEFORE_DELETE, $table_name, $named_parameters, $sql_query));
              try {
                  //Run Delete query, collect stats
                  $stmt = $this->db_connection->prepare($sql_query);
                  if (!empty($named_parameters)) {
                      foreach ($named_parameters as $k => $v) {
                          $stmt->bindValue($k, $v);
                      }
                  }
  
                  $stmt->execute();
              } catch (Exception $ex) {
                  Event::dispatch(EventData::forException($ex, $sql_query, $named_parameters));
  
                  throw new QueryException($ex->getMessage(), $ex->getCode(), $ex);
              }
  
              $rows_affected = $stmt->rowCount();
              Event::dispatch(EventData::forAfter(Event::AFTER_DELETE, $table_name, $named_parameters, $sql_query, $rows_affected));
  
              return $rows_affected;
  
          }
code: function deleteWhere($table_name, $where_with_placeholders, $named_parameters) {
  
              if (empty($where_with_placeholders) || !$table_name) {
                  return false;
              }
  
              $sql_query = 'DELETE FROM ' . $table_name . ' WHERE ' . $where_with_placeholders;
  
              Event::dispatch(EventData::forBefore(Event::BEFORE_DELETE, $table_name, $named_parameters, $sql_query));
              try {
                  //Run Delete query, collect stats
                  $stmt = $this->db_connection->prepare($sql_query);
                  if (!empty($named_parameters)) {
                      foreach ($named_parameters as $k => $v) {
                          $stmt->bindValue($k, $v);
                      }
                  }
  
                  $stmt->execute();
              } catch (Exception $ex) {
                  Event::dispatch(EventData::forException($ex, $sql_query, $named_parameters));
  
                  throw new QueryException($ex->getMessage(), $ex->getCode(), $ex);
              }
  
              $rows_affected = $stmt->rowCount();
              Event::dispatch(EventData::forAfter(Event::AFTER_DELETE, $table_name, $named_parameters, $sql_query, $rows_affected));
  
              return $rows_affected;
  
          }
code_tokens: function deleteWhere ( $ table_name , $ where_with_placeholders , $ named_parameters ) { if ( empty ( $ where_with_placeholders ) || ! $ table_name ) { return false ; } $ sql_query = 'DELETE FROM ' . $ table_name . ' WHERE ' . $ where_with_placeholders ; Event :: dispatch ( EventData :: forBefore ( Event :: BEFORE_DELETE , $ table_name , $ named_parameters , $ sql_query ) ) ; try { //Run Delete query, collect stats $ stmt = $ this -> db_connection -> prepare ( $ sql_query ) ; if ( ! empty ( $ named_parameters ) ) { foreach ( $ named_parameters as $ k => $ v ) { $ stmt -> bindValue ( $ k , $ v ) ; } } $ stmt -> execute ( ) ; } catch ( Exception $ ex ) { Event :: dispatch ( EventData :: forException ( $ ex , $ sql_query , $ named_parameters ) ) ; throw new QueryException ( $ ex -> getMessage ( ) , $ ex -> getCode ( ) , $ ex ) ; } $ rows_affected = $ stmt -> rowCount ( ) ; Event :: dispatch ( EventData :: forAfter ( Event :: AFTER_DELETE , $ table_name , $ named_parameters , $ sql_query , $ rows_affected ) ) ; return $ rows_affected ; }
docstring: Performs an SQL delete with a 'WHERE' clause
  
  @param string $table_name
  @param string $where_with_placeholders
  @param array  $named_parameters
  
  @return bool|int rows_affected
  @throws QueryException
docstring_tokens: Performs an SQL delete with a WHERE clause