Created
November 22, 2016 18:52
-
-
Save wilcorrea/68e890fe3349c62d551174376226e52a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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