From d40198ab958bb175e8d30e9d035ef968f1735df2 Mon Sep 17 00:00:00 2001 From: Malloc of Kuzkycyziklistan Date: Mon, 6 Mar 2017 16:03:02 -0600 Subject: [PATCH] wwo small --- AroMVC/Database/Insertable.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/AroMVC/Database/Insertable.php b/AroMVC/Database/Insertable.php index 850abb3..3e81634 100644 --- a/AroMVC/Database/Insertable.php +++ b/AroMVC/Database/Insertable.php @@ -3,8 +3,20 @@ namespace AroMVC\Database; class Insertable extends Queryable { protected $table = null; - protected $names = []; - protected $values = []; + protected $fields = []; + public function __construct(string $table) { + $this->table = $table; + } + public function value(string $name, $value): Insertable { + $fields[$name] = $value; + return $this; + } + + public function values(array $values): Insertable { + foreach($values as $name => $value) + $fields[$name] = $value; + return $this; + } } \ No newline at end of file