Skip to content

Instantly share code, notes, and snippets.

@wilcorrea
Created November 22, 2016 18:52
Show Gist options
  • Select an option

  • Save wilcorrea/68e890fe3349c62d551174376226e52a to your computer and use it in GitHub Desktop.

Select an option

Save wilcorrea/68e890fe3349c62d551174376226e52a to your computer and use it in GitHub Desktop.
<?php
namespace Hero;
/**
* Class QueryBuilder
* @package Hero
*/
class QueryBuilder
{
/**
* QueryBuilder constructor.
*/
public function __construct()
{
// configure
}
/**
* @param string $table
* @param string $fields
* @param string $values
*/
public function insert($table, $fields, $values)
{
// INSERT INTO {table} ({fields}) VALUES ({values});
}
/**
* @param string $table
* @param string $fields
*/
public function select($table, $fields)
{
// SELECT {fields} FROM <JOIN> {table} <WHERE> <GROUP> <ORDER> <HAVING> <LIMIT>;
}
/**
* @param string $table
* @param string $set
*/
public function update($table, $set)
{
// UPDATE {table} SET {set} <WHERE>
}
/**
* @param string $table
*/
public function delete($table)
{
// DELETE FROM {table} <JOIN> <USING> <WHERE>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment