From c4d26fbf82e96e24e8060154189eb40bda3a6172 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Thu, 8 Sep 2022 17:41:37 -0400 Subject: [PATCH] Query "Factory" --- src/Database/QueryBuilder.php | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/Database/QueryBuilder.php diff --git a/src/Database/QueryBuilder.php b/src/Database/QueryBuilder.php new file mode 100644 index 0000000..a9bd65e --- /dev/null +++ b/src/Database/QueryBuilder.php @@ -0,0 +1,37 @@ +container = $container; + return $this; + } + public function getContainer(): ContainerInterface + { + return $this->container; + } + + public function select(array $columns = ['*']): Select + { + return $this->getContainer()->get(Select::class)->select($columns); + } + public function insert(string $table): Insert + { + return $this->getContainer()->get(Insert::class)->into($table); + } + public function update(string $table): Update + { + return $this->getContainer()->get(Update::class)->table($table); + } + public function delete(string $table): Delete + { + return $this->getContainer()->get(Delete::class)->from($table); + } +}